added app frame
This commit is contained in:
parent
9f63e72ff8
commit
b3faa6e059
2 changed files with 59 additions and 0 deletions
27
css/ui/views.css
Normal file
27
css/ui/views.css
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
.breadcrumbs {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.breadcrumbs a {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
div.appframe-titlebar {
|
||||
padding: 6px;
|
||||
background: #eeeeee; /* Old browsers */
|
||||
background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 100%); /* FF3.6+ */
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#cccccc)); /* Chrome,Safari4+ */
|
||||
background: -webkit-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -o-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Opera 11.10+ */
|
||||
background: -ms-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* IE10+ */
|
||||
background: linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 ); /* IE6-9 */
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
div.appframe-toolbar {
|
||||
padding: 4px;
|
||||
background: #eeeeee;
|
||||
border-top: 1px solid #f8f8f8;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
32
js/wn/views/appframe.js
Normal file
32
js/wn/views/appframe.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
wn.views.AppFrame = Class.extend({
|
||||
init: function(parent) {
|
||||
this.buttons = {};
|
||||
this.$w = $('<div></div>').appendTo(parent);
|
||||
|
||||
this.$titlebar = $('<div class="appframe-titlebar">\
|
||||
<span class="close">×</span>\
|
||||
</div>').appendTo(this.$w);
|
||||
|
||||
this.$w.find('.close').click(function() {
|
||||
window.history.back();
|
||||
})
|
||||
|
||||
},
|
||||
add_button: function(label, click, icon) {
|
||||
if(!this.$w.find('.appframe-toolbar').length)
|
||||
this.$w.append('<div class="appframe-toolbar"></div>');
|
||||
|
||||
args = { label: label, icon:'' };
|
||||
if(icon) {
|
||||
args.icon = '<i class="'+icon+'"></i>';
|
||||
}
|
||||
this.buttons[label] = $(repl('<button class="btn btn-small">\
|
||||
%(icon)s %(label)s</button>', args))
|
||||
.click(click)
|
||||
.appendTo(this.$w.find('.appframe-toolbar'));
|
||||
|
||||
},
|
||||
clear_buttons: function() {
|
||||
this.$w.find('.appframe-toolbar').empty();
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Reference in a new issue