Fix indent rule in ES5
[MAILPOET-1029]
This commit is contained in:
@@ -182,24 +182,24 @@ define('modal', ['mailpoet', 'jquery'],
|
||||
initOverlay: function(toggle) {
|
||||
if(jQuery('#mailpoet_modal_overlay').length === 0) {
|
||||
// insert overlay into the DOM
|
||||
jQuery('body').append(this.templates.overlay);
|
||||
jQuery('body').append(this.templates.overlay);
|
||||
// insert loading indicator into overlay
|
||||
jQuery('#mailpoet_modal_overlay').append(this.templates.loading);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
toggleOverlay: function(toggle) {
|
||||
if(toggle === true) {
|
||||
jQuery('#mailpoet_modal_overlay')
|
||||
jQuery('#mailpoet_modal_overlay').append(this.templates.loading);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
toggleOverlay: function(toggle) {
|
||||
if(toggle === true) {
|
||||
jQuery('#mailpoet_modal_overlay')
|
||||
.removeClass('mailpoet_overlay_hidden');
|
||||
} else {
|
||||
jQuery('#mailpoet_modal_overlay')
|
||||
} else {
|
||||
jQuery('#mailpoet_modal_overlay')
|
||||
.addClass('mailpoet_overlay_hidden');
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
setupEvents: function() {
|
||||
return this;
|
||||
},
|
||||
setupEvents: function() {
|
||||
// close popup when user clicks on close button
|
||||
jQuery('#mailpoet_modal_close').on('click', this.cancel.bind(this));
|
||||
|
||||
@@ -250,39 +250,39 @@ define('modal', ['mailpoet', 'jquery'],
|
||||
loadTemplate: function() {
|
||||
if(this.subpanels.length > 0) {
|
||||
// hide panel
|
||||
jQuery('.mailpoet_'+this.options.type+'_wrapper').hide();
|
||||
jQuery('.mailpoet_'+this.options.type+'_wrapper').hide();
|
||||
|
||||
// add sub panel wrapper
|
||||
jQuery('#mailpoet_'+this.options.type)
|
||||
jQuery('#mailpoet_'+this.options.type)
|
||||
.append(this.templates['subpanel']);
|
||||
|
||||
// add sub panel content
|
||||
jQuery('.mailpoet_'+this.options.type+'_body').last()
|
||||
jQuery('.mailpoet_'+this.options.type+'_body').last()
|
||||
.html(this.subpanels[(this.subpanels.length - 1)].element);
|
||||
|
||||
// focus on sub panel
|
||||
if(this.options.focus) {
|
||||
this.focus();
|
||||
}
|
||||
} else if (this.options.element) {
|
||||
jQuery('.mailpoet_'+this.options.type+'_body').empty();
|
||||
jQuery('.mailpoet_'+this.options.type+'_body')
|
||||
if(this.options.focus) {
|
||||
this.focus();
|
||||
}
|
||||
} else if (this.options.element) {
|
||||
jQuery('.mailpoet_'+this.options.type+'_body').empty();
|
||||
jQuery('.mailpoet_'+this.options.type+'_body')
|
||||
.append(this.options.element);
|
||||
} else {
|
||||
jQuery('.mailpoet_'+this.options.type+'_body')
|
||||
} else {
|
||||
jQuery('.mailpoet_'+this.options.type+'_body')
|
||||
.html(
|
||||
this.options.body_template(
|
||||
this.options.data
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
loadUrl: function() {
|
||||
if(this.options.method === 'get') {
|
||||
return this;
|
||||
},
|
||||
loadUrl: function() {
|
||||
if(this.options.method === 'get') {
|
||||
// make ajax request
|
||||
jQuery.getJSON(this.options.url,
|
||||
jQuery.getJSON(this.options.url,
|
||||
function(data) {
|
||||
this.options.data = jQuery.extend({}, this.options.data, data);
|
||||
// load template using fetched data
|
||||
@@ -291,9 +291,9 @@ define('modal', ['mailpoet', 'jquery'],
|
||||
this.showModal();
|
||||
}.bind(this)
|
||||
);
|
||||
} else if(this.options.method === 'post') {
|
||||
} else if(this.options.method === 'post') {
|
||||
// make ajax request
|
||||
jQuery.post(this.options.url, JSON.stringify(this.options.params),
|
||||
jQuery.post(this.options.url, JSON.stringify(this.options.params),
|
||||
function(data) {
|
||||
this.options.data = jQuery.extend({}, this.options.data, data);
|
||||
// load template using fetched data
|
||||
@@ -303,342 +303,342 @@ define('modal', ['mailpoet', 'jquery'],
|
||||
}.bind(this),
|
||||
'json'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
setDimensions: function() {
|
||||
switch(this.options.type) {
|
||||
case 'popup':
|
||||
return this;
|
||||
},
|
||||
setDimensions: function() {
|
||||
switch(this.options.type) {
|
||||
case 'popup':
|
||||
// set popup dimensions
|
||||
jQuery('#mailpoet_popup').css({
|
||||
width: this.options.width,
|
||||
height: this.options.height
|
||||
});
|
||||
jQuery('#mailpoet_popup').css({
|
||||
width: this.options.width,
|
||||
height: this.options.height
|
||||
});
|
||||
// set popup wrapper height
|
||||
jQuery('#mailpoet_popup_wrapper').css({
|
||||
height: this.options.height
|
||||
});
|
||||
jQuery('#mailpoet_popup_wrapper').css({
|
||||
height: this.options.height
|
||||
});
|
||||
break;
|
||||
case 'panel':
|
||||
case 'panel':
|
||||
// set dimensions
|
||||
if(this.options.position === 'right') {
|
||||
jQuery('#mailpoet_panel').css({
|
||||
width: this.options.width,
|
||||
right: 0,
|
||||
marginRight: '-' + this.options.width,
|
||||
left: 'auto'
|
||||
});
|
||||
} else if(this.options.position === 'left') {
|
||||
jQuery('#mailpoet_panel').css({
|
||||
width: this.options.width,
|
||||
left: 0,
|
||||
marginLeft: '-' + this.options.width,
|
||||
right: 'auto'
|
||||
});
|
||||
}
|
||||
jQuery('#mailpoet_panel').css({ minHeight: 'auto' });
|
||||
if(this.options.position === 'right') {
|
||||
jQuery('#mailpoet_panel').css({
|
||||
width: this.options.width,
|
||||
right: 0,
|
||||
marginRight: '-' + this.options.width,
|
||||
left: 'auto'
|
||||
});
|
||||
} else if(this.options.position === 'left') {
|
||||
jQuery('#mailpoet_panel').css({
|
||||
width: this.options.width,
|
||||
left: 0,
|
||||
marginLeft: '-' + this.options.width,
|
||||
right: 'auto'
|
||||
});
|
||||
}
|
||||
jQuery('#mailpoet_panel').css({ minHeight: 'auto' });
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
setPosition: function() {
|
||||
switch(this.options.type) {
|
||||
case 'popup':
|
||||
var screenWidth = jQuery(window).width(),
|
||||
return this;
|
||||
},
|
||||
setPosition: function() {
|
||||
switch(this.options.type) {
|
||||
case 'popup':
|
||||
var screenWidth = jQuery(window).width(),
|
||||
screenHeight = jQuery(window).height(),
|
||||
modalWidth = jQuery('.mailpoet_'+ this.options.type +'_wrapper').width(),
|
||||
modalHeight = jQuery('.mailpoet_'+ this.options.type +'_wrapper').height();
|
||||
|
||||
var top = Math.max(48, parseInt((screenHeight / 2) - (modalHeight / 2))),
|
||||
var top = Math.max(48, parseInt((screenHeight / 2) - (modalHeight / 2))),
|
||||
left = Math.max(0, parseInt((screenWidth / 2) - (modalWidth / 2)));
|
||||
|
||||
// set position of popup depending on screen dimensions.
|
||||
jQuery('#mailpoet_popup').css({
|
||||
top: top,
|
||||
left: left
|
||||
});
|
||||
jQuery('#mailpoet_popup').css({
|
||||
top: top,
|
||||
left: left
|
||||
});
|
||||
break;
|
||||
case 'panel':
|
||||
setTimeout(function() {
|
||||
case 'panel':
|
||||
setTimeout(function() {
|
||||
// set position of popup depending on screen dimensions.
|
||||
if(this.options.position === 'right') {
|
||||
jQuery('#mailpoet_panel').css({
|
||||
marginRight: 0
|
||||
});
|
||||
} else if(this.options.position === 'left') {
|
||||
jQuery('#mailpoet_panel').css({
|
||||
marginLeft: 0
|
||||
});
|
||||
}
|
||||
}.bind(this), 0);
|
||||
if(this.options.position === 'right') {
|
||||
jQuery('#mailpoet_panel').css({
|
||||
marginRight: 0
|
||||
});
|
||||
} else if(this.options.position === 'left') {
|
||||
jQuery('#mailpoet_panel').css({
|
||||
marginLeft: 0
|
||||
});
|
||||
}
|
||||
}.bind(this), 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
showModal: function() {
|
||||
return this;
|
||||
},
|
||||
showModal: function() {
|
||||
// set modal dimensions
|
||||
this.setDimensions();
|
||||
this.setDimensions();
|
||||
|
||||
// remember the previously focused element
|
||||
this.prevFocus = jQuery(':focus');
|
||||
this.prevFocus = jQuery(':focus');
|
||||
|
||||
// add a flag on the body so that we can prevent scrolling
|
||||
jQuery('body').addClass('mailpoet_modal_opened');
|
||||
jQuery('body').addClass('mailpoet_modal_opened');
|
||||
|
||||
// show popup
|
||||
jQuery('#mailpoet_'+this.options.type).show();
|
||||
jQuery('#mailpoet_'+this.options.type).show();
|
||||
|
||||
// display overlay
|
||||
this.showOverlay();
|
||||
this.showOverlay();
|
||||
|
||||
// set modal position
|
||||
this.setPosition();
|
||||
this.setPosition();
|
||||
|
||||
// add class on highlighted elements
|
||||
if(this.options.highlight !== null) {
|
||||
if(this.options.highlight.length > 0) {
|
||||
this.highlightOn(this.options.highlight);
|
||||
}
|
||||
if(this.options.highlight !== null) {
|
||||
if(this.options.highlight.length > 0) {
|
||||
this.highlightOn(this.options.highlight);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.options.focus) {
|
||||
this.focus();
|
||||
}
|
||||
|
||||
// set popup as opened
|
||||
this.opened = true;
|
||||
|
||||
// trigger init event if specified
|
||||
if(this.options.onInit !== null) {
|
||||
this.options.onInit(this);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
focus: function() {
|
||||
if(this.options.type == 'popup') {
|
||||
jQuery('#mailpoet_'+this.options.type).focus();
|
||||
} else {
|
||||
// panel and subpanel
|
||||
jQuery('#mailpoet_'+this.options.type+' .mailpoet_panel_wrapper')
|
||||
.filter(':visible').focus();
|
||||
}
|
||||
return this;
|
||||
},
|
||||
highlightOn: function(element) {
|
||||
jQuery(element).addClass('mailpoet_modal_highlight');
|
||||
return this;
|
||||
},
|
||||
highlightOff: function() {
|
||||
jQuery('.mailpoet_modal_highlight')
|
||||
.removeClass('mailpoet_modal_highlight');
|
||||
return this;
|
||||
},
|
||||
hideModal: function(callback) {
|
||||
// set modal as closed
|
||||
this.opened = false;
|
||||
|
||||
// hide modal
|
||||
jQuery('#mailpoet_'+this.options.type).hide();
|
||||
|
||||
// remove class on highlighted elements
|
||||
this.highlightOff();
|
||||
|
||||
// remove class from body to let it be scrollable
|
||||
jQuery('body').removeClass('mailpoet_modal_opened');
|
||||
|
||||
return this;
|
||||
},
|
||||
showOverlay: function(force) {
|
||||
jQuery('#mailpoet_modal_overlay').show();
|
||||
return this;
|
||||
},
|
||||
hideOverlay: function() {
|
||||
jQuery('#mailpoet_modal_overlay').hide();
|
||||
return this;
|
||||
},
|
||||
popup: function(opts) {
|
||||
// get options
|
||||
var options = opts || {};
|
||||
// set modal type
|
||||
options.type = 'popup';
|
||||
// set overlay state
|
||||
options.overlay = options.overlay || true;
|
||||
// initialize modal
|
||||
this.init(options);
|
||||
// open modal
|
||||
this.open();
|
||||
|
||||
return this;
|
||||
},
|
||||
panel: function(opts) {
|
||||
// get options
|
||||
var options = opts || {};
|
||||
// reset subpanels
|
||||
this.subpanels = [];
|
||||
// set modal type
|
||||
options.type = 'panel';
|
||||
// set overlay state
|
||||
options.overlay = options.overlay || false;
|
||||
// set highlighted element
|
||||
options.highlight = options.highlight || null;
|
||||
// set modal dimensions
|
||||
options.width = options.width || '40%';
|
||||
options.height = options.height || 'auto';
|
||||
// initialize modal
|
||||
this.init(options);
|
||||
// open modal
|
||||
this.open();
|
||||
|
||||
return this;
|
||||
},
|
||||
subpanel: function(options) {
|
||||
if(this.opened === false) {
|
||||
// if no panel is already opened, let's create one instead
|
||||
this.panel(options);
|
||||
} else {
|
||||
// if a panel is already opened, add a sub panel to it
|
||||
this.subpanels.push(options);
|
||||
this.loadTemplate();
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
loading: function(toggle) {
|
||||
// make sure the overlay is initialized and that it's visible
|
||||
this.initOverlay(true);
|
||||
|
||||
if(toggle === true) {
|
||||
this.showLoading();
|
||||
} else {
|
||||
this.hideLoading();
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
showLoading: function() {
|
||||
jQuery('#mailpoet_loading').show();
|
||||
|
||||
// add loading class to overlay
|
||||
jQuery('#mailpoet_modal_overlay')
|
||||
.addClass('mailpoet_overlay_loading');
|
||||
|
||||
return this;
|
||||
},
|
||||
hideLoading: function() {
|
||||
jQuery('#mailpoet_loading').hide();
|
||||
|
||||
// remove loading class from overlay
|
||||
jQuery('#mailpoet_modal_overlay')
|
||||
.removeClass('mailpoet_overlay_loading');
|
||||
|
||||
return this;
|
||||
},
|
||||
open: function() {
|
||||
// load template if specified
|
||||
if(this.options.template !== null) {
|
||||
// check if a url was specified to get extra data
|
||||
if(this.options.url !== null) {
|
||||
this.loadUrl();
|
||||
} else {
|
||||
// load template
|
||||
this.loadTemplate();
|
||||
|
||||
// show modal window
|
||||
this.showModal();
|
||||
}
|
||||
} else {
|
||||
this.cancel();
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
success: function() {
|
||||
if(this.subpanels.length > 0) {
|
||||
if(this.subpanels[(this.subpanels.length - 1)].onSuccess !== undefined) {
|
||||
this.subpanels[(this.subpanels.length - 1)].onSuccess(this.subpanels[(this.subpanels.length - 1)].data);
|
||||
}
|
||||
} else {
|
||||
if(this.options.onSuccess !== null) {
|
||||
this.options.onSuccess(this.options.data);
|
||||
}
|
||||
}
|
||||
this.close();
|
||||
|
||||
return this;
|
||||
},
|
||||
cancel: function() {
|
||||
if(this.subpanels.length > 0) {
|
||||
if(this.subpanels[(this.subpanels.length - 1)].onCancel !== undefined) {
|
||||
this.subpanels[(this.subpanels.length - 1)].onCancel(this.subpanels[(this.subpanels.length - 1)].data);
|
||||
}
|
||||
} else {
|
||||
if(this.options.onCancel !== null) {
|
||||
this.options.onCancel(this.options.data);
|
||||
}
|
||||
}
|
||||
this.close();
|
||||
|
||||
return this;
|
||||
},
|
||||
destroy: function() {
|
||||
this.hideOverlay();
|
||||
|
||||
// remove extra modal
|
||||
if(jQuery('#mailpoet_'+this.options.type).length > 0) {
|
||||
jQuery('#mailpoet_'+this.options.type).remove();
|
||||
}
|
||||
|
||||
this.initialized = false;
|
||||
|
||||
return this;
|
||||
},
|
||||
close: function() {
|
||||
if(this.isLocked() === true) { return this; }
|
||||
|
||||
if(this.subpanels.length > 0) {
|
||||
// close subpanel
|
||||
jQuery('.mailpoet_'+this.options.type+'_wrapper').last().remove();
|
||||
|
||||
// show previous panel
|
||||
jQuery('.mailpoet_'+this.options.type+'_wrapper').last().show();
|
||||
|
||||
// remove last subpanels
|
||||
this.subpanels.pop();
|
||||
|
||||
// focus on previous panel
|
||||
if(this.options.focus) {
|
||||
this.focus();
|
||||
}
|
||||
|
||||
// set popup as opened
|
||||
this.opened = true;
|
||||
|
||||
// trigger init event if specified
|
||||
if(this.options.onInit !== null) {
|
||||
this.options.onInit(this);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
focus: function() {
|
||||
if(this.options.type == 'popup') {
|
||||
jQuery('#mailpoet_'+this.options.type).focus();
|
||||
} else {
|
||||
// panel and subpanel
|
||||
jQuery('#mailpoet_'+this.options.type+' .mailpoet_panel_wrapper')
|
||||
.filter(':visible').focus();
|
||||
}
|
||||
return this;
|
||||
},
|
||||
highlightOn: function(element) {
|
||||
jQuery(element).addClass('mailpoet_modal_highlight');
|
||||
return this;
|
||||
},
|
||||
highlightOff: function() {
|
||||
jQuery('.mailpoet_modal_highlight')
|
||||
.removeClass('mailpoet_modal_highlight');
|
||||
return this;
|
||||
},
|
||||
hideModal: function(callback) {
|
||||
// set modal as closed
|
||||
this.opened = false;
|
||||
|
||||
// hide modal
|
||||
jQuery('#mailpoet_'+this.options.type).hide();
|
||||
|
||||
// remove class on highlighted elements
|
||||
this.highlightOff();
|
||||
|
||||
// remove class from body to let it be scrollable
|
||||
jQuery('body').removeClass('mailpoet_modal_opened');
|
||||
|
||||
return this;
|
||||
},
|
||||
showOverlay: function(force) {
|
||||
jQuery('#mailpoet_modal_overlay').show();
|
||||
return this;
|
||||
},
|
||||
hideOverlay: function() {
|
||||
jQuery('#mailpoet_modal_overlay').hide();
|
||||
return this;
|
||||
},
|
||||
popup: function(opts) {
|
||||
// get options
|
||||
var options = opts || {};
|
||||
// set modal type
|
||||
options.type = 'popup';
|
||||
// set overlay state
|
||||
options.overlay = options.overlay || true;
|
||||
// initialize modal
|
||||
this.init(options);
|
||||
// open modal
|
||||
this.open();
|
||||
|
||||
return this;
|
||||
},
|
||||
panel: function(opts) {
|
||||
// get options
|
||||
var options = opts || {};
|
||||
// reset subpanels
|
||||
this.subpanels = [];
|
||||
// set modal type
|
||||
options.type = 'panel';
|
||||
// set overlay state
|
||||
options.overlay = options.overlay || false;
|
||||
// set highlighted element
|
||||
options.highlight = options.highlight || null;
|
||||
// set modal dimensions
|
||||
options.width = options.width || '40%';
|
||||
options.height = options.height || 'auto';
|
||||
// initialize modal
|
||||
this.init(options);
|
||||
// open modal
|
||||
this.open();
|
||||
|
||||
return this;
|
||||
},
|
||||
subpanel: function(options) {
|
||||
if(this.opened === false) {
|
||||
// if no panel is already opened, let's create one instead
|
||||
this.panel(options);
|
||||
} else {
|
||||
// if a panel is already opened, add a sub panel to it
|
||||
this.subpanels.push(options);
|
||||
this.loadTemplate();
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
loading: function(toggle) {
|
||||
// make sure the overlay is initialized and that it's visible
|
||||
this.initOverlay(true);
|
||||
|
||||
if(toggle === true) {
|
||||
this.showLoading();
|
||||
} else {
|
||||
this.hideLoading();
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
showLoading: function() {
|
||||
jQuery('#mailpoet_loading').show();
|
||||
|
||||
// add loading class to overlay
|
||||
jQuery('#mailpoet_modal_overlay')
|
||||
.addClass('mailpoet_overlay_loading');
|
||||
|
||||
return this;
|
||||
},
|
||||
hideLoading: function() {
|
||||
jQuery('#mailpoet_loading').hide();
|
||||
|
||||
// remove loading class from overlay
|
||||
jQuery('#mailpoet_modal_overlay')
|
||||
.removeClass('mailpoet_overlay_loading');
|
||||
|
||||
return this;
|
||||
},
|
||||
open: function() {
|
||||
// load template if specified
|
||||
if(this.options.template !== null) {
|
||||
// check if a url was specified to get extra data
|
||||
if(this.options.url !== null) {
|
||||
this.loadUrl();
|
||||
} else {
|
||||
// load template
|
||||
this.loadTemplate();
|
||||
|
||||
// show modal window
|
||||
this.showModal();
|
||||
}
|
||||
} else {
|
||||
this.cancel();
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
success: function() {
|
||||
if(this.subpanels.length > 0) {
|
||||
if(this.subpanels[(this.subpanels.length - 1)].onSuccess !== undefined) {
|
||||
this.subpanels[(this.subpanels.length - 1)].onSuccess(this.subpanels[(this.subpanels.length - 1)].data);
|
||||
}
|
||||
} else {
|
||||
if(this.options.onSuccess !== null) {
|
||||
this.options.onSuccess(this.options.data);
|
||||
}
|
||||
}
|
||||
this.close();
|
||||
|
||||
return this;
|
||||
},
|
||||
cancel: function() {
|
||||
if(this.subpanels.length > 0) {
|
||||
if(this.subpanels[(this.subpanels.length - 1)].onCancel !== undefined) {
|
||||
this.subpanels[(this.subpanels.length - 1)].onCancel(this.subpanels[(this.subpanels.length - 1)].data);
|
||||
}
|
||||
} else {
|
||||
if(this.options.onCancel !== null) {
|
||||
this.options.onCancel(this.options.data);
|
||||
}
|
||||
}
|
||||
this.close();
|
||||
|
||||
return this;
|
||||
},
|
||||
destroy: function() {
|
||||
this.hideOverlay();
|
||||
|
||||
// remove extra modal
|
||||
if(jQuery('#mailpoet_'+this.options.type).length > 0) {
|
||||
jQuery('#mailpoet_'+this.options.type).remove();
|
||||
}
|
||||
|
||||
this.initialized = false;
|
||||
|
||||
return this;
|
||||
},
|
||||
close: function() {
|
||||
if(this.isLocked() === true) { return this; }
|
||||
|
||||
if(this.subpanels.length > 0) {
|
||||
// close subpanel
|
||||
jQuery('.mailpoet_'+this.options.type+'_wrapper').last().remove();
|
||||
|
||||
// show previous panel
|
||||
jQuery('.mailpoet_'+this.options.type+'_wrapper').last().show();
|
||||
|
||||
// remove last subpanels
|
||||
this.subpanels.pop();
|
||||
|
||||
// focus on previous panel
|
||||
if(this.options.focus) {
|
||||
this.focus();
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// remove event handlers
|
||||
this.removeEvents();
|
||||
|
||||
// hide modal window
|
||||
this.hideModal();
|
||||
|
||||
// destroy modal element
|
||||
this.destroy();
|
||||
|
||||
// restore the previously focused element
|
||||
if(this.prevFocus !== undefined){
|
||||
this.prevFocus.focus();
|
||||
}
|
||||
|
||||
// reset options
|
||||
this.options = {
|
||||
onSuccess: null,
|
||||
onCancel: null
|
||||
};
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// remove event handlers
|
||||
this.removeEvents();
|
||||
|
||||
// hide modal window
|
||||
this.hideModal();
|
||||
|
||||
// destroy modal element
|
||||
this.destroy();
|
||||
|
||||
// restore the previously focused element
|
||||
if(this.prevFocus !== undefined){
|
||||
this.prevFocus.focus();
|
||||
}
|
||||
|
||||
// reset options
|
||||
this.options = {
|
||||
onSuccess: null,
|
||||
onCancel: null
|
||||
};
|
||||
|
||||
return this;
|
||||
}
|
||||
};
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user