Commit a812e6e8 authored by catch's avatar catch
Browse files

Issue #1428524 by nod_: Follow-up to fix dashboard after replacing all...

Issue #1428524 by nod_: Follow-up to fix dashboard after replacing all $.each() with filtered for loop.
parent 215c3e82
......@@ -51,7 +51,7 @@ Drupal.attachBehaviors = function (context, settings) {
var i, behaviors = Drupal.behaviors;
// Execute all of them.
for (i in behaviors) {
if (behaviors.hasOwnProperty(i) && behaviors[i].attach) {
if (behaviors.hasOwnProperty(i) && typeof behaviors[i].attach === 'function') {
behaviors[i].attach(context, settings);
}
}
......@@ -104,7 +104,7 @@ Drupal.detachBehaviors = function (context, settings, trigger) {
var i, behaviors = Drupal.behaviors;
// Execute all of them.
for (i in behaviors) {
if (behaviors.hasOwnProperty(i) && behaviors[i].detach) {
if (behaviors.hasOwnProperty(i) && typeof behaviors[i].detach === 'function' ) {
behaviors[i].detach(context, settings, trigger);
}
}
......
......@@ -212,9 +212,9 @@ Drupal.behaviors.dashboard = {
$('#dashboard div.region').each(function () {
var region = $(this).parent().attr('id').replace(/-/g, '_');
var blocks = $(this).sortable('toArray');
order = $.map(blocks, function (block) {
return region + '[]=' + block;
});
for (var i = 0, il = blocks.length; i < il; i += 1) {
order.push(region + '[]=' + blocks[i]);
}
});
order = order.join('&');
return order;
......
Supports Markdown
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