Notification system

This commit is contained in:
Ruud committed 2012-03-14 20:33:22 +01:00
1 parent 2323136221
commit 15175a0330
25 files changed
+1313 -165

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
Block.Menu = new Class({
Extends: BlockBase,
options: {
'class': 'menu'
},
create: function(){
var self = this;
self.el = new Element('div', {
'class': 'more_menu '+self.options['class']
}).adopt(
self.more_option_ul = new Element('ul'),
new Element('a.button.onlay', {
'events': {
'click': function(){
self.el.toggleClass('show')
self.fireEvent(self.el.hasClass('show') ? 'open' : 'close')
if(self.el.hasClass('show'))
this.addEvent('outerClick', function(){
self.el.removeClass('show')
this.removeEvents('outerClick');
})
else
this.removeEvents('outerClick');
}
}
})
)
},
addLink: function(tab, position){
var self = this;
var el = new Element('li').adopt(tab).inject(self.more_option_ul, position || 'bottom');
return el;
}
});
-54
View File
@@ -1,54 +0,0 @@
Block.More = new Class({
Extends: BlockBase,
create: function(){
var self = this;
self.el = new Element('div.more_menu').adopt(
self.more_option_ul = new Element('ul').adopt(
new Element('li').adopt(
new Element('a.orange', {
'text': 'Restart',
'events': {
'click': App.restart.bind(App)
}
})
),
new Element('li').adopt(
new Element('a.red', {
'text': 'Shutdown',
'events': {
'click': App.shutdown.bind(App)
}
})
)
),
new Element('a.button.onlay', {
'events': {
'click': function(){
self.el.toggleClass('show')
if(self.el.hasClass('show'))
this.addEvent('outerClick', function(){
self.el.removeClass('show')
this.removeEvents('outerClick');
})
else
this.removeEvents('outerClick');
}
}
})
)
},
addLink: function(tab, position){
var self = this
return new Element('li').adopt(tab).inject(self.more_option_ul, position || 'bottom')
}
});