Attempt to avoid clashes with browsers that treat 'delete' as a reserved keyword
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 28 Jul 2009 05:05:37 +0000 (05:05 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 28 Jul 2009 05:05:37 +0000 (05:05 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13749 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/PermaCrud.js
Open-ILS/web/opac/skin/default/js/rdetail.js

index a6d7a87..5e4f49b 100644 (file)
@@ -296,6 +296,14 @@ if(!dojo._hasResource["openils.PermaCrud"]) {
             this._CUD( 'delete', list, opts );
         },
 
+       /* 
+        * 'delete' is a reserved keyword in JavaScript and can't be used
+        * in browsers like IE or Chrome, so we define a safe synonym
+        */
+        eliminate: function ( list, opts ) {
+            this._CUD( 'delete', list, opts );
+        },
+
         apply : function ( list, opts ) {
             this._auto_CUD( list, opts );
         },
index a41c61c..66df723 100644 (file)
@@ -305,7 +305,7 @@ function _holdingsDrawMFHD(holdings, entryNum) {
                        var pcrud = new openils.PermaCrud({"authtoken": G.user.session});
                        var mfhd_rec = pcrud.retrieve("sre", holdings.id());
                        if (mfhd_rec) {
-                               pcrud.delete(mfhd_rec);
+                               pcrud.eliminate(mfhd_rec);
                                alert(dojo.string.substitute(opac_strings.DELETED_MFHD_RECORD, [holdings.id()]));
                        }
                }, label:opac_strings.DELETE_MFHD}).placeAt(mfhd_edit, "last");