Notification system
This commit is contained in:
1 parent
2323136221
commit
15175a0330
25 files changed
+1313
-165
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
});
|
||||
@@ -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')
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
Reference in new issue
Block a user