From 62a623a9923e00c270d0e9a8bf7626df8213d5f7 Mon Sep 17 00:00:00 2001 From: Marc Wiest Date: Mon, 12 Oct 2015 09:55:27 +0200 Subject: [PATCH] Code cleanup Removed unused code and fixed potentially uninitialized elem variable --- jquery.dialogOptions.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/jquery.dialogOptions.js b/jquery.dialogOptions.js index 02f3bdc..21db903 100644 --- a/jquery.dialogOptions.js +++ b/jquery.dialogOptions.js @@ -42,8 +42,6 @@ $.ui.dialog.prototype.options.showCloseButton = true; // extend _init var _init = $.ui.dialog.prototype._init; $.ui.dialog.prototype._init = function () { - var self = this; - // apply original arguments _init.apply(this, arguments); @@ -72,15 +70,12 @@ $.ui.dialog.prototype.open = function () { // responsive width & height var resize = function () { - + var elem = self.element; // check if responsive // dependent on modernizr for device detection / html.touch if (self.options.responsive === true || (self.options.responsive === "touch" && isTouch)) { - var elem = self.element, - wHeight = $(window).height(), + var wHeight = $(window).height(), wWidth = $(window).width(), - dHeight = elem.parent().outerHeight(), - dWidth = elem.parent().outerWidth(), setHeight = Math.min(wHeight * self.options.scaleH, oHeight), setWidth = Math.min(wWidth * self.options.scaleW, oWidth);