From b48ba9823d34cdd6ebfe8d85d178f1a1ffcfab26 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 21 Dec 2012 12:31:44 +0530 Subject: [PATCH] added '+' button to file selector and rounded corners --- public/css/legacy/dialog.css | 5 +---- public/css/ui/appframe.css | 1 + public/css/ui/layout.css | 5 +++++ public/js/legacy/widgets/form/fields.js | 11 ++++++++++- public/js/legacy/widgets/form/form.js | 3 +-- public/js/wn/model/model.js | 5 ++++- public/js/wn/ui/appframe.js | 10 ---------- public/js/wn/views/doclistview.js | 1 - public/js/wn/views/reportview.js | 1 - 9 files changed, 22 insertions(+), 20 deletions(-) diff --git a/public/css/legacy/dialog.css b/public/css/legacy/dialog.css index 080ba6ed78..22c5928e36 100644 --- a/public/css/legacy/dialog.css +++ b/public/css/legacy/dialog.css @@ -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; } diff --git a/public/css/ui/appframe.css b/public/css/ui/appframe.css index 7e8488f100..0737687efd 100644 --- a/public/css/ui/appframe.css +++ b/public/css/ui/appframe.css @@ -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 { diff --git a/public/css/ui/layout.css b/public/css/ui/layout.css index 8a5e56db31..c4964b13d1 100644 --- a/public/css/ui/layout.css +++ b/public/css/ui/layout.css @@ -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 { diff --git a/public/js/legacy/widgets/form/fields.js b/public/js/legacy/widgets/form/fields.js index bf37fc4407..5834bd9e28 100644 --- a/public/js/legacy/widgets/form/fields.js +++ b/public/js/legacy/widgets/form/fields.js @@ -1006,6 +1006,15 @@ SelectField.prototype.make_input = function() { if(this.df.options == 'attach_files:') { this.file_attach = true; + $(this.input).css({"width": "70%"}); + $("") + .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.") } } diff --git a/public/js/legacy/widgets/form/form.js b/public/js/legacy/widgets/form/form.js index ff4312caed..c068c0aa52 100644 --- a/public/js/legacy/widgets/form/form.js +++ b/public/js/legacy/widgets/form/form.js @@ -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); } diff --git a/public/js/wn/model/model.js b/public/js/wn/model/model.js index 2a3276d45b..d82a833df1 100644 --- a/public/js/wn/model/model.js +++ b/public/js/wn/model/model.js @@ -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) { diff --git a/public/js/wn/ui/appframe.js b/public/js/wn/ui/appframe.js index a46d70affe..73444e3056 100644 --- a/public/js/wn/ui/appframe.js +++ b/public/js/wn/ui/appframe.js @@ -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 = $('') .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); } \ No newline at end of file diff --git a/public/js/wn/views/doclistview.js b/public/js/wn/views/doclistview.js index 44b54ddd90..7530b02151 100644 --- a/public/js/wn/views/doclistview.js +++ b/public/js/wn/views/doclistview.js @@ -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); }, diff --git a/public/js/wn/views/reportview.js b/public/js/wn/views/reportview.js index 5dd0165193..080f4dc129 100644 --- a/public/js/wn/views/reportview.js +++ b/public/js/wn/views/reportview.js @@ -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({