webstaff: teach manage authorities about the new MARC editor
authorGalen Charlton <gmc@esilibrary.com>
Fri, 28 Aug 2015 00:48:17 +0000 (00:48 +0000)
committerJason Stephenson <jstephenson@mvlc.org>
Mon, 14 Sep 2015 19:44:16 +0000 (15:44 -0400)
At the moment, a new window is opened. It might be worth seeing
if we can open a dijit.Dialog instead, but... that might be
pushing our luck.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/web/js/ui/default/cat/authority/list.js

index ba62550..17b59a8 100644 (file)
@@ -13,6 +13,7 @@ dojo.require("fieldmapper.Fieldmapper");
 dojo.require('openils.CGI');
 dojo.require('openils.PermaCrud');
 dojo.require('openils.XUL');
+dojo.require('openils.Util');
 dojo.require('openils.widget.OrgUnitFilteringSelect');
 dojo.require("openils.widget.PCrudAutocompleteBox");
 dojo.require("MARC.FixedFields");
@@ -285,6 +286,13 @@ function loadMarcEditor(pcrud, rec) {
     /* Setting an explicit height results in a super skinny window, so fix that up */
     var initWidth = self.outerWidth / 2;
 
+    if (openils.Util.inIframe()) {
+        initWidth = initHeight;
+        win = window.open('/eg/staff/cat/catalog/authority/' + rec.id() + '/marc_edit','',    // XXX version?
+            'chrome,resizable=yes,height=' + initHeight + ',width=' + initWidth);
+        return;
+    }
+
     /*
        To run in Firefox directly, must set signed.applets.codebase_principal_support
        to true in about:config