added '+' button to file selector and rounded corners

This commit is contained in:
Rushabh Mehta 2012-12-21 12:31:44 +05:30
parent 51af7ee50a
commit b48ba9823d
9 changed files with 22 additions and 20 deletions

View file

@ -10,10 +10,7 @@ div.dialog_wrapper {
-moz-box-shadow: 1px 1px 8px #444;
-webkit-box-shadow: 1px 1px 8px #444;
/*border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;*/
border-radius: 5px;
overflow: hidden;
}

View file

@ -7,6 +7,7 @@ div.appframe-titlebar {
color: #555;
border-bottom: 1px solid #c2c2c2;
vertical-align: middle;
border-radius: 5px 5px 0px 0px;
}
div.appframe-marker {

View file

@ -9,6 +9,7 @@ h5 {
-webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.9);
box-shadow: 0px 0px 3px rgba(0,0,0,0.9);
background-color: #fff;
border-radius: 5px;
padding: 15px;
}
@ -19,11 +20,13 @@ h5 {
.layout-main {
padding: 15px;
background-color: #fff;
border-radius: 5px;
}
.layout-wrapper-background {
background-color: #f2f2f2 !important;
padding: 0px;
border-radius: 5px;
}
.layout-main-section {
@ -35,6 +38,7 @@ h5 {
-moz-box-shadow: 1px 0px 1px #ccc;
-webkit-box-shadow: 1px 0px 1px #ccc;
box-shadow: 1px 0px 1px #ccc;
border-radius: 0px 0px 0px 5px;
}
.layout-side-section {
@ -44,6 +48,7 @@ h5 {
overflow-x: hidden;
padding: 15px;
min-height: 540px;
border-radius: 0px 0px 5px 0px;
}
.layout-main-section h4 {

View file

@ -1006,6 +1006,15 @@ SelectField.prototype.make_input = function() {
if(this.df.options == 'attach_files:') {
this.file_attach = true;
$(this.input).css({"width": "70%"});
$("<button class='btn' title='Add attachment'\
style='margin-bottom: 9px; \
padding-left: 6px; padding-right: 6px; margin-left: 6px;'>\
<i class='icon-plus'></i></button>")
.click(function() {
cur_frm.attachments.new_attachment();
})
.appendTo(this.input_area);
}
}
@ -1114,7 +1123,7 @@ SelectField.prototype.make_input = function() {
}
} else {
this.df.options = ''
this.set_description("Please upload file first.")
this.set_description("Please attach a file first.")
}
}

View file

@ -576,7 +576,7 @@ _f.Frm.prototype.refresh = function(docname) {
if(this.layout) this.layout.show();
// call onload post render for callbacks to be fired
if(cur_frm.cscript.is_onload) {
if(this.cscript.is_onload) {
this.runclientscript('onload_post_render', this.doctype, this.docname);
}
@ -758,7 +758,6 @@ _f.Frm.prototype.edit_doc = function() {
this.refresh();
}
_f.Frm.prototype.show_doc = function(dn) {
this.refresh(dn);
}

View file

@ -183,10 +183,13 @@ $.extend(wn.model, {
$.each(wn.model.get_doclist(doctype, name), function(i, d) {
if(d) wn.model.clear_doc(d.doctype, d.name);
});
if(wn.views.formview[doctype]) {
delete wn.views.formview[doctype].opendocs[name];
}
},
clear_doc: function(doctype, name) {
delete locals[doctype][name];
delete locals[doctype][name];
},
copy_doc: function(dt, dn, from_amend) {

View file

@ -19,8 +19,6 @@ wn.ui.AppFrame = Class.extend({
if(title)
this.set_title(title);
if(module)
this.set_marker(module);
},
title: function(txt) {
this.set_title(txt);
@ -30,13 +28,6 @@ wn.ui.AppFrame = Class.extend({
document.title = txt;
this.$titlebar.find(".appframe-title").html(txt);
},
set_marker: function(module) {
var color = wn.get_module_color(module);
this.$titlebar.find(".appframe-marker")
.css({
"background-color": color
});
},
add_tab: function(tab_name, opacity, click) {
var span = $('<span class="appframe-tab"></span>')
.html(tab_name).insertAfter(this.$titlebar.find(".close"));
@ -143,5 +134,4 @@ wn.ui.make_app_page = function(opts) {
if(opts.set_document_title!==undefined)
opts.parent.appframe.set_document_title = opts.set_document_title;
if(opts.title) opts.parent.appframe.title(opts.title);
if(opts.module) opts.parent.appframe.set_marker(opts.module);
}

View file

@ -82,7 +82,6 @@ wn.views.DocListView = wn.ui.Listing.extend({
var module = locals.DocType[this.doctype].module;
this.appframe.set_title(this.doctype + " List");
this.appframe.set_marker(module);
this.appframe.add_module_tab(module);
},

View file

@ -28,7 +28,6 @@ wn.views.ReportViewPage = Class.extend({
make_report_view: function() {
var module = locals.DocType[this.doctype].module;
this.page.appframe.set_title(this.doctype);
this.page.appframe.set_marker(module);
this.page.appframe.add_module_tab(module);
this.page.reportview = new wn.views.ReportView({