Commit 2c5a1983 authored by Dries's avatar Dries

- Patch #444402 by sun: clean up of parseInt() usage.

parent efab1afc
...@@ -293,7 +293,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) { ...@@ -293,7 +293,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) {
self.rowObject.swap('before', previousRow); self.rowObject.swap('before', previousRow);
self.rowObject.interval = null; self.rowObject.interval = null;
self.rowObject.indent(0); self.rowObject.indent(0);
window.scrollBy(0, -parseInt(item.offsetHeight)); window.scrollBy(0, -parseInt(item.offsetHeight, 10));
} }
handle.get(0).focus(); // Regain focus after the DOM manipulation. handle.get(0).focus(); // Regain focus after the DOM manipulation.
} }
...@@ -325,7 +325,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) { ...@@ -325,7 +325,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) {
nextGroupRow = $(nextGroup.group).filter(':last').get(0); nextGroupRow = $(nextGroup.group).filter(':last').get(0);
self.rowObject.swap('after', nextGroupRow); self.rowObject.swap('after', nextGroupRow);
// No need to check for indentation, 0 is the only valid one. // No need to check for indentation, 0 is the only valid one.
window.scrollBy(0, parseInt(groupHeight)); window.scrollBy(0, parseInt(groupHeight, 10));
} }
} }
else { else {
...@@ -333,7 +333,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) { ...@@ -333,7 +333,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) {
self.rowObject.swap('after', nextRow); self.rowObject.swap('after', nextRow);
self.rowObject.interval = null; self.rowObject.interval = null;
self.rowObject.indent(0); self.rowObject.indent(0);
window.scrollBy(0, parseInt(item.offsetHeight)); window.scrollBy(0, parseInt(item.offsetHeight, 10));
} }
handle.get(0).focus(); // Regain focus after the DOM manipulation. handle.get(0).focus(); // Regain focus after the DOM manipulation.
} }
...@@ -524,11 +524,11 @@ Drupal.tableDrag.prototype.findDropTargetRow = function (x, y) { ...@@ -524,11 +524,11 @@ Drupal.tableDrag.prototype.findDropTargetRow = function (x, y) {
// table cells, grab the firstChild of the row and use that instead. // table cells, grab the firstChild of the row and use that instead.
// http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari. // http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari.
if (row.offsetHeight == 0) { if (row.offsetHeight == 0) {
var rowHeight = parseInt(row.firstChild.offsetHeight) / 2; var rowHeight = parseInt(row.firstChild.offsetHeight, 10) / 2;
} }
// Other browsers. // Other browsers.
else { else {
var rowHeight = parseInt(row.offsetHeight) / 2; var rowHeight = parseInt(row.offsetHeight, 10) / 2;
} }
// Because we always insert before, we need to offset the height a bit. // Because we always insert before, we need to offset the height a bit.
...@@ -697,7 +697,7 @@ Drupal.tableDrag.prototype.updateField = function (changedRow, group) { ...@@ -697,7 +697,7 @@ Drupal.tableDrag.prototype.updateField = function (changedRow, group) {
} }
else { else {
// Assume a numeric input field. // Assume a numeric input field.
var weight = parseInt($(targetClass, siblings[0]).val()) || 0; var weight = parseInt($(targetClass, siblings[0]).val(), 10) || 0;
$(targetClass, siblings).each(function () { $(targetClass, siblings).each(function () {
this.value = weight; this.value = weight;
weight++; weight++;
......
...@@ -10,7 +10,7 @@ Drupal.tableHeaderDoScroll = function () { ...@@ -10,7 +10,7 @@ Drupal.tableHeaderDoScroll = function () {
Drupal.behaviors.tableHeader = { Drupal.behaviors.tableHeader = {
attach: function (context, settings) { attach: function (context, settings) {
// This breaks in anything less than IE 7. Prevent it from running. // This breaks in anything less than IE 7. Prevent it from running.
if ($.browser.msie && parseInt($.browser.version) < 7) { if ($.browser.msie && parseInt($.browser.version, 10) < 7) {
return; return;
} }
......
...@@ -26,7 +26,7 @@ Drupal.behaviors.color = { ...@@ -26,7 +26,7 @@ Drupal.behaviors.color = {
// Build a preview. // Build a preview.
$('#preview').once('color').append('<div id="gradient"></div>'); $('#preview').once('color').append('<div id="gradient"></div>');
var gradient = $('#preview #gradient'); var gradient = $('#preview #gradient');
var h = parseInt(gradient.css('height')) / 10; var h = parseInt(gradient.css('height'), 10) / 10;
for (i = 0; i < h; ++i) { for (i = 0; i < h; ++i) {
gradient.append('<div class="gradient-line"></div>'); gradient.append('<div class="gradient-line"></div>');
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment