Skip to content
Browse files

Fix calling hideModal. Thanks to Oleg.

  • Loading branch information...
1 parent 05a4818 commit afeac7d43fab9f7544f00bad95d0447a8d372ea3 @tonytomov committed
Showing with 4 additions and 4 deletions.
  1. +2 −2 js/grid.common.js
  2. +2 −2 js/grid.formedit.js
View
4 js/grid.common.js
@@ -21,7 +21,7 @@ $.extend($.jgrid,{
hideModal : function (selector,o) {
o = $.extend({jqm : true, gb :''}, o || {});
if(o.onClose) {
- var oncret = o.onClose(selector);
+ var oncret = o.gb && typeof o.gb === "string" && o.gb.substr(0,6) === "#gbox_" ? o.onClose.call($("#" + o.gb.substr(6))[0], selector) : o.onClose(selector);
if (typeof oncret == 'boolean' && !oncret ) { return; }
}
if ($.fn.jqm && o.jqm === true) {
@@ -151,7 +151,7 @@ $.extend($.jgrid,{
$(mw).keydown( function( e ) {
if( e.which == 27 ) {
var cone = $("#"+$.jgrid.jqID(aIDs.themodal)).data("onClose") || p.onClose;
- self.hideModal(this,{gb:p.gbox,jqm:p.jqModal,onClose: cone});
+ self.hideModal("#"+$.jgrid.jqID(aIDs.themodal),{gb:p.gbox,jqm:p.jqModal,onClose: cone});
}
});
}
View
4 js/grid.formedit.js
@@ -1038,7 +1038,7 @@ $.jgrid.extend({
}
if(e.which === 27) {
if(!checkUpdates()) {return false;}
- if(cle) {$.jgrid.hideModal(this,{gb:p.gbox,jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});}
+ if(cle) {$.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:p.gbox,jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});}
return false;
}
if(rp_ge[$t.p.id].navkeys[0]===true) {
@@ -1420,7 +1420,7 @@ $.jgrid.extend({
bt = null;
$("#"+IDs.themodal).keydown( function( e ) {
if(e.which === 27) {
- if(rp_ge[$t.p.id].closeOnEscape) {$.jgrid.hideModal(this,{gb:p.gbox,jqm:p.jqModal, onClose: p.onClose});}
+ if(rp_ge[$t.p.id].closeOnEscape) {$.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:p.gbox,jqm:p.jqModal, onClose: p.onClose});}
return false;
}
if(p.navkeys[0]===true) {

0 comments on commit afeac7d

Please sign in to comment.
Something went wrong with that request. Please try again.