summaryrefslogtreecommitdiff
path: root/misc/tabledrag.js
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-09-20 19:14:40 +0000
committerDries Buytaert <dries@buytaert.net>2009-09-20 19:14:40 +0000
commit2c5a198366b035f5b37d6446d620aa86b3abbf83 (patch)
treee6bc58c5fbfb1d749f03c0d1a4156202d428da72 /misc/tabledrag.js
parentefab1afcc6c73249d8bf44366c5ddad1bc8dcafa (diff)
downloadbrdo-2c5a198366b035f5b37d6446d620aa86b3abbf83.tar.gz
brdo-2c5a198366b035f5b37d6446d620aa86b3abbf83.tar.bz2
- Patch #444402 by sun: clean up of parseInt() usage.
Diffstat (limited to 'misc/tabledrag.js')
-rw-r--r--misc/tabledrag.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/misc/tabledrag.js b/misc/tabledrag.js
index 0c7acbc75..d79eda06c 100644
--- a/misc/tabledrag.js
+++ b/misc/tabledrag.js
@@ -293,7 +293,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) {
self.rowObject.swap('before', previousRow);
self.rowObject.interval = null;
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.
}
@@ -325,7 +325,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) {
nextGroupRow = $(nextGroup.group).filter(':last').get(0);
self.rowObject.swap('after', nextGroupRow);
// No need to check for indentation, 0 is the only valid one.
- window.scrollBy(0, parseInt(groupHeight));
+ window.scrollBy(0, parseInt(groupHeight, 10));
}
}
else {
@@ -333,7 +333,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) {
self.rowObject.swap('after', nextRow);
self.rowObject.interval = null;
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.
}
@@ -524,11 +524,11 @@ Drupal.tableDrag.prototype.findDropTargetRow = function (x, y) {
// 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.
if (row.offsetHeight == 0) {
- var rowHeight = parseInt(row.firstChild.offsetHeight) / 2;
+ var rowHeight = parseInt(row.firstChild.offsetHeight, 10) / 2;
}
// Other browsers.
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.
@@ -697,7 +697,7 @@ Drupal.tableDrag.prototype.updateField = function (changedRow, group) {
}
else {
// 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 () {
this.value = weight;
weight++;