Révision 219d19c4
Ajouté par Assos Assos il y a plus de 3 ans
drupal7/sites/all/modules/ctools/js/ajax-responder.js | ||
---|---|---|
98 | 98 |
}; |
99 | 99 |
|
100 | 100 |
// Hide these in a ready to ensure that Drupal.ajax is set up first. |
101 |
$(function() { |
|
102 |
Drupal.ajax.prototype.commands.attr = function(ajax, data, status) { |
|
103 |
$(data.selector).attr(data.name, data.value); |
|
104 |
}; |
|
101 |
Drupal.behaviors.ctools_add_ajax_responder_commands = { |
|
102 |
attach: function () { |
|
103 |
Drupal.ajax.prototype.commands.attr = function (ajax, data, status) { |
|
104 |
$(data.selector).attr(data.name, data.value); |
|
105 |
}; |
|
105 | 106 |
|
106 |
|
|
107 |
Drupal.ajax.prototype.commands.redirect = function(ajax, data, status) { |
|
108 |
if (data.delay > 0) { |
|
109 |
setTimeout(function () { |
|
107 |
Drupal.ajax.prototype.commands.redirect = function (ajax, data, status) { |
|
108 |
if (data.delay > 0) { |
|
109 |
setTimeout(function () { |
|
110 |
location.href = data.url; |
|
111 |
}, data.delay); |
|
112 |
} |
|
113 |
else { |
|
110 | 114 |
location.href = data.url; |
111 |
}, data.delay); |
|
112 |
} |
|
113 |
else { |
|
114 |
location.href = data.url; |
|
115 |
} |
|
116 |
}; |
|
115 |
} |
|
116 |
}; |
|
117 | 117 |
|
118 |
Drupal.ajax.prototype.commands.reload = function(ajax, data, status) {
|
|
119 |
location.reload(); |
|
120 |
}; |
|
118 |
Drupal.ajax.prototype.commands.reload = function (ajax, data, status) {
|
|
119 |
location.reload();
|
|
120 |
};
|
|
121 | 121 |
|
122 |
Drupal.ajax.prototype.commands.submit = function(ajax, data, status) { |
|
123 |
$(data.selector).submit(); |
|
122 |
Drupal.ajax.prototype.commands.submit = function (ajax, data, status) { |
|
123 |
$(data.selector).submit(); |
|
124 |
} |
|
124 | 125 |
} |
125 |
});
|
|
126 |
}; |
|
126 | 127 |
})(jQuery); |
Formats disponibles : Unified diff
Weekly update of contrib modules