width: $dimensions.width
}, options);
},
-
+
/**
* Shows an element by sliding and fading it into viewport.
*
$.widget('ui.wcfDialog', $.ui.dialog, {
_init: function() {
this.options.autoOpen = true;
+ this.options.hide = {
+ effect: 'fade'
+ };
this.options.close = function(event, ui) {
- $(this).parent('.ui-dialog').wcfDropOut('down', $.proxy(function() {
- $(this).parent('.ui-dialog').empty().remove();
- }, this));
+ $(this).parent('.ui-dialog').empty().remove();
};
this.options.height = 'auto';
this.options.minHeight = 0;
this.options.width = 'auto';
$.ui.dialog.prototype._init.apply(this, arguments);
+
+ // center dialog on resize
+ $(window).resize($.proxy(function() {
+ this.option('position', 'center');
+ }, this));
}
});
this.options.modal = true;
this.options.hide = {
- effect: 'drop',
- direction: 'down'
+ effect: 'fade'
};
this.options.close = function(event, ui) {
this.element.parent('.ui-dialog').find('a.ui-dialog-titlebar-close').empty().remove();
}
}
+
+ // center dialog on window resize
+ $(window).resize($.proxy(function() {
+ this.option('position', 'center');
+ }, this));
},
/**