From 4ba898f0d94d57ab969875146eacff5009f783f2 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 29 May 2013 11:23:43 +0530 Subject: [PATCH 1/4] [toolbars] removed view / module menus --- public/js/wn/form/toolbar.js | 42 +++++++++--------------------- public/js/wn/ui/toolbar/toolbar.js | 16 +++--------- 2 files changed, 16 insertions(+), 42 deletions(-) diff --git a/public/js/wn/form/toolbar.js b/public/js/wn/form/toolbar.js index 9ca6e7adf9..f312481573 100644 --- a/public/js/wn/form/toolbar.js +++ b/public/js/wn/form/toolbar.js @@ -19,7 +19,6 @@ wn.ui.form.Toolbar = Class.extend({ } this.make_file_menu(); - this.make_view_menu(); if(!this.frm.view_is_edit) { // print view this.show_print_toolbar(); @@ -155,10 +154,22 @@ wn.ui.form.Toolbar = Class.extend({ this.appframe.add_dropdown_button("File", wn._("Email..."), function() { me.frm.email_doc();}, 'icon-envelope'); } + + // Linked With + if(!me.frm.doc.__islocal && !me.frm.meta.issingle) { + this.appframe.add_dropdown_button("File", wn._('Linked With'), function() { + if(!me.frm.linked_with) { + me.frm.linked_with = new wn.ui.form.LinkedWith({ + frm: me.frm + }); + } + me.frm.linked_with.show(); + }, "icon-link") + } // copy if(in_list(profile.can_create, me.frm.doctype) && !me.frm.meta.allow_copy) { - this.appframe.add_dropdown_button("File", wn._("Make Copy"), function() { + this.appframe.add_dropdown_button("File", wn._("Copy"), function() { me.frm.copy_doc();}, 'icon-file'); } @@ -176,33 +187,6 @@ wn.ui.form.Toolbar = Class.extend({ } }, - make_view_menu: function() { - var me = this; - // Edit - if(this.frm.meta.read_only_onload && !this.frm.doc.__islocal) { - this.appframe.add_dropdown_button("View", wn._('Print View'), function() { - me.frm.last_view_is_edit[me.frm.docname] = 0; - me.frm.refresh(); }, 'icon-print'); - } - - if(this.frm.meta.read_only_onload && !this.frm.doc.__islocal) { - this.appframe.add_dropdown_button("View", wn._('Edit'), function() { - me.frm.last_view_is_edit[me.frm.docname] = 1; - me.frm.refresh(); }, 'icon-edit'); - } - - // Linked With - if(!me.frm.doc.__islocal && !me.frm.meta.issingle) { - this.appframe.add_dropdown_button("View", wn._('Linked With'), function() { - if(!me.frm.linked_with) { - me.frm.linked_with = new wn.ui.form.LinkedWith({ - frm: me.frm - }); - } - me.frm.linked_with.show(); - }, "icon-link") - } - }, set_title_button: function() { var me = this; var docstatus = cint(this.frm.doc.docstatus); diff --git a/public/js/wn/ui/toolbar/toolbar.js b/public/js/wn/ui/toolbar/toolbar.js index a44d6fca3e..8be3706a87 100644 --- a/public/js/wn/ui/toolbar/toolbar.js +++ b/public/js/wn/ui/toolbar/toolbar.js @@ -24,9 +24,8 @@ wn.ui.toolbar.Toolbar = Class.extend({ init: function() { this.make(); - this.make_erpnext(); + //this.make_modules(); this.make_file(); - this.make_view(); //this.make_actions(); wn.ui.toolbar.recent = new wn.ui.toolbar.RecentDocs(); wn.ui.toolbar.bookmarks = new wn.ui.toolbar.Bookmarks(); @@ -72,11 +71,11 @@ wn.ui.toolbar.Toolbar = Class.extend({ $('.navbar-brand').attr('href', "#"); }, - make_erpnext: function() { + make_modules: function() { $('').prependTo('.navbar .nav:first'); @@ -135,15 +134,6 @@ wn.ui.toolbar.Toolbar = Class.extend({ '); }, - make_view: function() { - $('.navbar .nav:first').append(''); - }, // make_actions: function() { // $('.navbar .nav:first').append('