Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/js/ajax.js | ||
---|---|---|
25 | 25 |
}); |
26 | 26 |
|
27 | 27 |
$('form', ajax_body).once('views-ajax-submit-processed').each(function() { |
28 |
var element_settings = { 'url': response.url, 'event': 'submit', 'progress': { 'type': 'throbber' } }; |
|
28 |
var element_settings = { |
|
29 |
'url': response.url, |
|
30 |
'event': 'submit', |
|
31 |
'progress': { |
|
32 |
'type': 'throbber' |
|
33 |
} |
|
34 |
}; |
|
29 | 35 |
var $form = $(this); |
30 | 36 |
var id = $form.attr('id'); |
31 | 37 |
Drupal.ajax[id] = new Drupal.ajax(id, this, element_settings); |
... | ... | |
90 | 96 |
}; |
91 | 97 |
|
92 | 98 |
/** |
93 |
* Get rid of irritating tabledrag messages |
|
99 |
* Get rid of irritating tabledrag messages.
|
|
94 | 100 |
*/ |
95 | 101 |
Drupal.theme.tableDragChangedWarning = function () { |
96 | 102 |
return []; |
... | ... | |
143 | 149 |
|
144 | 150 |
var base_element_settings = { |
145 | 151 |
'event': 'click', |
146 |
'progress': { 'type': 'throbber' } |
|
152 |
'progress': { |
|
153 |
'type': 'throbber' |
|
154 |
} |
|
147 | 155 |
}; |
148 | 156 |
// Bind AJAX behaviors to all items showing the class. |
149 | 157 |
$('a.views-ajax-link', context).once('views-ajax-processed').each(function () { |
... | ... | |
158 | 166 |
|
159 | 167 |
$('div#views-live-preview a') |
160 | 168 |
.once('views-ajax-processed').each(function () { |
161 |
// We don't bind to links without a URL. |
|
162 |
if (!$(this).attr('href')) { |
|
163 |
return true; |
|
164 |
} |
|
169 |
// We don't bind to links without a URL.
|
|
170 |
if (!$(this).attr('href')) {
|
|
171 |
return true;
|
|
172 |
}
|
|
165 | 173 |
|
166 |
var element_settings = base_element_settings; |
|
167 |
// Set the URL to go to the anchor. |
|
168 |
element_settings.url = $(this).attr('href'); |
|
169 |
if (Drupal.Views.getPath(element_settings.url).substring(0, 21) != 'admin/structure/views') { |
|
170 |
return true; |
|
171 |
} |
|
174 |
var element_settings = base_element_settings;
|
|
175 |
// Set the URL to go to the anchor.
|
|
176 |
element_settings.url = $(this).attr('href');
|
|
177 |
if (Drupal.Views.getPath(element_settings.url).substring(0, 21) != 'admin/structure/views') {
|
|
178 |
return true;
|
|
179 |
}
|
|
172 | 180 |
|
173 |
element_settings.wrapper = 'views-live-preview'; |
|
174 |
element_settings.method = 'html'; |
|
175 |
var base = $(this).attr('id'); |
|
176 |
Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings); |
|
177 |
}); |
|
181 |
element_settings.wrapper = 'views-live-preview';
|
|
182 |
element_settings.method = 'html';
|
|
183 |
var base = $(this).attr('id');
|
|
184 |
Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings);
|
|
185 |
});
|
|
178 | 186 |
|
179 | 187 |
// Within a live preview, make exposed widget form buttons re-trigger the |
180 | 188 |
// Preview button. |
... | ... | |
182 | 190 |
// of the main Edit form. |
183 | 191 |
$('div#views-live-preview input[type=submit]') |
184 | 192 |
.once('views-ajax-processed').each(function(event) { |
185 |
$(this).click(function () { |
|
186 |
this.form.clk = this; |
|
187 |
return true; |
|
188 |
}); |
|
189 |
var element_settings = base_element_settings; |
|
190 |
// Set the URL to go to the anchor. |
|
191 |
element_settings.url = $(this.form).attr('action'); |
|
192 |
if (Drupal.Views.getPath(element_settings.url).substring(0, 21) != 'admin/structure/views') { |
|
193 |
return true; |
|
194 |
} |
|
193 |
$(this).click(function () {
|
|
194 |
this.form.clk = this;
|
|
195 |
return true;
|
|
196 |
});
|
|
197 |
var element_settings = base_element_settings;
|
|
198 |
// Set the URL to go to the anchor.
|
|
199 |
element_settings.url = $(this.form).attr('action');
|
|
200 |
if (Drupal.Views.getPath(element_settings.url).substring(0, 21) != 'admin/structure/views') {
|
|
201 |
return true;
|
|
202 |
}
|
|
195 | 203 |
|
196 |
element_settings.wrapper = 'views-live-preview'; |
|
197 |
element_settings.method = 'html'; |
|
198 |
element_settings.event = 'click'; |
|
204 |
element_settings.wrapper = 'views-live-preview';
|
|
205 |
element_settings.method = 'html';
|
|
206 |
element_settings.event = 'click';
|
|
199 | 207 |
|
200 |
var base = $(this).attr('id'); |
|
201 |
Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings); |
|
202 |
}); |
|
208 |
var base = $(this).attr('id');
|
|
209 |
Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings);
|
|
210 |
});
|
|
203 | 211 |
|
204 | 212 |
if (!this.collapseReplaced && Drupal.collapseScrollIntoView) { |
205 | 213 |
this.collapseReplaced = true; |
206 | 214 |
Drupal.collapseScrollIntoView = function (node) { |
207 |
for (var $parent = $(node); $parent.get(0) != document && $parent.size() != 0; $parent = $parent.parent()) {
|
|
215 |
for (var $parent = $(node); $parent.get(0) != document && $parent.length != 0; $parent = $parent.parent()) {
|
|
208 | 216 |
if ($parent.css('overflow') == 'scroll' || $parent.css('overflow') == 'auto') { |
209 | 217 |
if (Drupal.viewsUi.resizeModal) { |
210 | 218 |
// If the modal is already at the max height, don't bother with |
Formats disponibles : Unified diff
Weekly update of contrib modules