Permalink
Browse files

Dialog: Removed deprecated position handling. Fixes #8825 - Dialog: R…

…emove array and string notations for position option.
  • Loading branch information...
scottgonzalez committed Mar 15, 2013
1 parent 4484c52 commit 0cc40d799ffdf7aa978f910b890915ee6ad7a2b8
View
@@ -318,7 +318,7 @@ grunt.initConfig({
files: expandFiles( "tests/unit/**/*.html" ).filter(function( file ) {
// disabling everything that doesn't (quite) work with PhantomJS for now
// TODO except for all|index|test, try to include more as we go
return !( /(all|index|test|dialog|dialog_deprecated|tabs|tooltip)\.html$/ ).test( file );
return !( /(all|index|test|dialog|tabs|tooltip)\.html$/ ).test( file );
})
},
jshint: {
View
@@ -16,7 +16,6 @@ var versions = {
"Core": "core/core.html",
"Datepicker": "datepicker/datepicker.html",
"Dialog": "dialog/dialog.html",
"Dialog_deprecated": "dialog/dialog_deprecated.html",
"Draggable": "draggable/draggable.html",
"Droppable": "droppable/droppable.html",
"Effects": "effects/effects.html",
View
@@ -22,7 +22,6 @@
"core/core.html",
"datepicker/datepicker.html",
"dialog/dialog.html",
"dialog/dialog_deprecated.html",
"draggable/draggable.html",
"droppable/droppable.html",
"effects/effects.html",

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
View
@@ -755,54 +755,4 @@ $.widget( "ui.dialog", {
$.ui.dialog.overlayInstances = 0;
// DEPRECATED
if ( $.uiBackCompat !== false ) {
// position option with array notation
// just override with old implementation
$.widget( "ui.dialog", $.ui.dialog, {
_position: function() {
var position = this.options.position,
myAt = [],
offset = [ 0, 0 ],
isVisible;
if ( position ) {
if ( typeof position === "string" || (typeof position === "object" && "0" in position ) ) {
myAt = position.split ? position.split(" ") : [ position[0], position[1] ];
if ( myAt.length === 1 ) {
myAt[1] = myAt[0];
}
$.each( [ "left", "top" ], function( i, offsetPosition ) {
if ( +myAt[ i ] === myAt[ i ] ) {
offset[ i ] = myAt[ i ];
myAt[ i ] = offsetPosition;
}
});
position = {
my: myAt[0] + (offset[0] < 0 ? offset[0] : "+" + offset[0]) + " " +
myAt[1] + (offset[1] < 0 ? offset[1] : "+" + offset[1]),
at: myAt.join(" ")
};
}
position = $.extend( {}, $.ui.dialog.prototype.options.position, position );
} else {
position = $.ui.dialog.prototype.options.position;
}
// need to show the dialog to get the actual offset in the position plugin
isVisible = this.uiDialog.is(":visible");
if ( !isVisible ) {
this.uiDialog.show();
}
this.uiDialog.position( position );
if ( !isVisible ) {
this.uiDialog.hide();
}
}
});
}
}( jQuery ) );

0 comments on commit 0cc40d7

Please sign in to comment.