ENHANCEMENT: allow each dialog pop to have their own extra class.

This commit is contained in:
Normann Lou 2012-04-03 12:48:43 +12:00
parent 5c3c3cb347
commit f1e0951483
2 changed files with 8 additions and 4 deletions

View File

@ -382,14 +382,15 @@ jQuery.noConflict();
this._super(); this._super();
var self = this, id = 'ss-ui-dialog-' + this.getUUID(); var self = this, id = 'ss-ui-dialog-' + this.getUUID();
var dialog = $('#' + id); var dialog = $('#' + id);
if(!dialog.length) { if(!dialog.length) {
dialog = $('<div class="ss-ui-dialog" id="' + id + '" />'); dialog = $('<div class="ss-ui-dialog" id="' + id + '" />');
$('body').append(dialog); $('body').append(dialog);
} }
dialog.ssdialog({iframeUrl: this.attr('href'), autoOpen: true}); var extraClass = this.data('popupclass')?this.data('popupclass'):'';
dialog.ssdialog({iframeUrl: this.attr('href'), autoOpen: true, dialogExtraClass: extraClass});
return false; return false;
} }
}); });

View File

@ -55,6 +55,7 @@
// Custom properties // Custom properties
iframeUrl: '', iframeUrl: '',
reloadOnOpen: true, reloadOnOpen: true,
dialogExtraClass: '',
// Defaults // Defaults
width: '80%', width: '80%',
@ -78,6 +79,8 @@
self._resizeIframe(); self._resizeIframe();
self.uiDialog.removeClass('loading'); self.uiDialog.removeClass('loading');
}).hide(); }).hide();
if(this.options.dialogExtraClass) this.uiDialog.addClass(this.options.dialogExtraClass);
this.element.append(iframe); this.element.append(iframe);
// Let the iframe handle its scrolling // Let the iframe handle its scrolling