From 3eb9f04221230edb57c98f01e9595cf6b64d7a98 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 19 Nov 2014 16:56:51 +0000 Subject: [PATCH] readded accidently removed _hide_navbar and iframe_location methods --- admin/js/app.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/admin/js/app.js b/admin/js/app.js index ba18d4b04a..743d8be374 100644 --- a/admin/js/app.js +++ b/admin/js/app.js @@ -211,6 +211,43 @@ app.classes.admin = AppJS.extend( } }, + /** + * Hide navbar for idots template + * + * Just a hack for old idots, not neccesary for jdots + */ + _hide_navbar: function() + { + var document = this.iframe.getDOMNode().contentDocument; + + if (!document) return; // nothing we can do ... + + // set white background, as transparent one lets account-list show through + document.getElementsByTagName('body')[0].style.backgroundColor = 'white'; + + // hide navbar elements + var ids2hide = ['divLogo', 'topmenu', 'divAppIconBar', 'divStatusBar', 'tdSidebox', 'divAppboxHeader']; + for(var i=0; i < ids2hide.length; ++i) + { + var elem = document.getElementById(ids2hide[i]); + if (elem) elem.style.display = 'none'; + } + }, + + /** + * Set location of iframe for given _action and _sender (row) + * + * @param _action + * @param _senders + */ + iframe_location: function(_action, _senders) + { + var id = _senders[0].id.split('::'); + var url = _action.data.url.replace(/(%24|\$)id/, id[1]); + + this.load(url); + }, + /** * Link hander for jDots template to just reload our iframe, instead of reloading whole admin app *