Skip to content

Commit

Permalink
Dialog: Removed shadow option due to introducing too many bugs. (Reop…
Browse files Browse the repository at this point in the history
…ens #3681).
  • Loading branch information
scottgonzalez committed Feb 5, 2009
1 parent 3b4cef1 commit dd3636c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 93 deletions.
1 change: 0 additions & 1 deletion tests/unit/dialog/dialog_defaults.js
Expand Up @@ -19,7 +19,6 @@ var dialog_defaults = {
modal: false, modal: false,
position: 'center', position: 'center',
resizable: true, resizable: true,
shadow: false,
stack: true, stack: true,
title: '', title: '',
width: 300, width: 300,
Expand Down
27 changes: 0 additions & 27 deletions tests/visual/dialog/dialog_option_shadow_false.html

This file was deleted.

27 changes: 0 additions & 27 deletions tests/visual/dialog/dialog_option_shadow_true.html

This file was deleted.

38 changes: 0 additions & 38 deletions ui/ui.dialog.js
Expand Up @@ -142,7 +142,6 @@ $.widget("ui.dialog", {


destroy: function() { destroy: function() {
(this.overlay && this.overlay.destroy()); (this.overlay && this.overlay.destroy());
(this.shadow && this._destroyShadow());
this.uiDialog.hide(); this.uiDialog.hide();
this.element this.element
.unbind('.dialog') .unbind('.dialog')
Expand All @@ -160,7 +159,6 @@ $.widget("ui.dialog", {
} }


(this.overlay && this.overlay.destroy()); (this.overlay && this.overlay.destroy());
(this.shadow && this._destroyShadow());
this.uiDialog this.uiDialog
.hide(this.options.hide) .hide(this.options.hide)
.unbind('keypress.ui-dialog'); .unbind('keypress.ui-dialog');
Expand Down Expand Up @@ -189,7 +187,6 @@ $.widget("ui.dialog", {
maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10) || options.zIndex); maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10) || options.zIndex);
}); });
(this.overlay && this.overlay.$el.css('z-index', ++maxZ)); (this.overlay && this.overlay.$el.css('z-index', ++maxZ));
(this.shadow && this.shadow.css('z-index', ++maxZ));


//Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed. //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
// http://ui.jquery.com/bugs/ticket/3193 // http://ui.jquery.com/bugs/ticket/3193
Expand All @@ -210,7 +207,6 @@ $.widget("ui.dialog", {
this._size(); this._size();
this._position(options.position); this._position(options.position);
uiDialog.show(options.show); uiDialog.show(options.show);
(options.shadow && this._createShadow());
this.moveToTop(true, event); this.moveToTop(true, event);


// prevent tabbing out of modal dialogs // prevent tabbing out of modal dialogs
Expand Down Expand Up @@ -307,12 +303,10 @@ $.widget("ui.dialog", {
}, },
drag: function() { drag: function() {
(options.drag && options.drag.apply(self.element[0], arguments)); (options.drag && options.drag.apply(self.element[0], arguments));
self._refreshShadow();
}, },
stop: function() { stop: function() {
(options.dragStop && options.dragStop.apply(self.element[0], arguments)); (options.dragStop && options.dragStop.apply(self.element[0], arguments));
$.ui.dialog.overlay.resize(); $.ui.dialog.overlay.resize();
self._refreshShadow();
} }
}); });
}, },
Expand All @@ -338,13 +332,11 @@ $.widget("ui.dialog", {
}, },
resize: function() { resize: function() {
(options.resize && options.resize.apply(self.element[0], arguments)); (options.resize && options.resize.apply(self.element[0], arguments));
self._refreshShadow();
}, },
handles: resizeHandles, handles: resizeHandles,
stop: function() { stop: function() {
(options.resizeStop && options.resizeStop.apply(self.element[0], arguments)); (options.resizeStop && options.resizeStop.apply(self.element[0], arguments));
$.ui.dialog.overlay.resize(); $.ui.dialog.overlay.resize();
self._refreshShadow();
} }
}) })
.find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se'); .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');
Expand Down Expand Up @@ -435,11 +427,6 @@ $.widget("ui.dialog", {
// currently non-resizable, becoming resizable // currently non-resizable, becoming resizable
(isResizable || this._makeResizable(value)); (isResizable || this._makeResizable(value));
break; break;
case "shadow":
(value
? this.shadow || this._createShadow()
: this.shadow && this._destroyShadow());
break;
case "title": case "title":
$(".ui-dialog-title", this.uiDialogTitlebar).html(value || ' '); $(".ui-dialog-title", this.uiDialogTitlebar).html(value || ' ');
break; break;
Expand Down Expand Up @@ -479,30 +466,6 @@ $.widget("ui.dialog", {
? 'auto' ? 'auto'
: options.height - nonContentHeight : options.height - nonContentHeight
}); });
},

_createShadow: function() {
this.shadow = $('<div class="ui-widget-shadow"></div>').css('position', 'absolute').appendTo(document.body);
this._refreshShadow();
return this.shadow;
},

_refreshShadow: function() {
if (!this.options.shadow) { return; }

var uiDialog = this.uiDialog,
offset = uiDialog.offset();
this.shadow.css({
left: offset.left,
top: offset.top,
width: uiDialog.outerWidth(),
height: uiDialog.outerHeight()
});
},

_destroyShadow: function() {
this.shadow.remove();
this.shadow = null;
} }
}); });


Expand All @@ -522,7 +485,6 @@ $.extend($.ui.dialog, {
modal: false, modal: false,
position: 'center', position: 'center',
resizable: true, resizable: true,
shadow: false,
stack: true, stack: true,
title: '', title: '',
width: 300, width: 300,
Expand Down

0 comments on commit dd3636c

Please sign in to comment.