diff --git a/js/edit.js b/js/edit.js index a2a9383..6fef97e 100644 --- a/js/edit.js +++ b/js/edit.js @@ -610,7 +610,7 @@ Drupal.edit.editables = { // The whole toolbar must move to the top when it's an inline editable. if ($editable.css('display') == 'inline') { - $toolbar.css('top', Drupal.edit.util.stripPX($toolbar.css('top')) - 5 + 'px'); + $toolbar.css('top', parseFloat($toolbar.css('top')) - 5 + 'px'); } // The primary toolgroups must move to the top and the left. @@ -631,7 +631,7 @@ Drupal.edit.editables = { $this.data('edit-toolbar-updating-clipping', true); var parts = $this.css('clip').split(' '); - parts[2] = Drupal.edit.util.stripPX(parts[2]) - 5 + 'px'; + parts[2] = parseFloat(parts[2]) - 5 + 'px'; $this.css('clip', parts.join(' ')); } }); @@ -669,7 +669,7 @@ Drupal.edit.editables = { // Move the toolbar & toolgroups to their original positions. if ($editable.css('display') == 'inline') { - $toolbar.css('top', Drupal.edit.util.stripPX($toolbar.css('top')) + 5 + 'px'); + $toolbar.css('top', parseFloat($toolbar.css('top')) + 5 + 'px'); } $toolbar.find('.edit-toolgroup') .removeClass('edit-animate-exception-grow') diff --git a/js/util.js b/js/util.js index d3c58c5..32ba314 100644 --- a/js/util.js +++ b/js/util.js @@ -62,25 +62,6 @@ Drupal.edit.util.ignoreHoveringVia = function(e, closest, callback) { }; /** - * Strip extraneous information ("px") from a given value in preparation - * for getPositionProperties(). - */ -Drupal.edit.util.stripPX = function(value) { - if (value) { - var index = value.indexOf('px'); - if (index === -1) { - return NaN; - } - else { - return Number(value.substring(0, index)); - } - } - else { - return NaN; - } -}; - -/** * If no position properties defined, replace value with zero. */ Drupal.edit.util.replaceBlankPosition = function(pos) { @@ -105,7 +86,7 @@ Drupal.edit.util.getPositionProperties = function($e) { for (var i = 0; i < props.length; i++) { p = props[i]; - r[p] = this.stripPX(this.replaceBlankPosition($e.css(p))); + r[p] = parseFloat(this.replaceBlankPosition($e.css(p))); } return r; };