comparison js/dnd-library.js @ 46:2ba96288fbea

Library: Add support for resetting exposed filters
author Franck Deroche <defr@ows.fr>
date Thu, 14 Jan 2010 15:42:39 +0000
parents 4344489b20e6
children cbfe386cb51b
comparison
equal deleted inserted replaced
45:4344489b20e6 46:2ba96288fbea
147 Drupal.behaviors.dndLibrary.renderLibrary.call(target, data, $(editor)); 147 Drupal.behaviors.dndLibrary.renderLibrary.call(target, data, $(editor));
148 } 148 }
149 }); 149 });
150 return false; 150 return false;
151 }); 151 });
152 $('.view-filters input[type=reset]', $this).click(function() {
153 var reset = $(this);
154 $('.view-filters form', $this).ajaxSubmit({
155 'url' : Drupal.settings.basePath + settings.url,
156 'dataType' : 'json',
157 'success' : function(data) {
158 var target = reset.parents('div.dnd-library-wrapper');
159 Drupal.behaviors.dndLibrary.renderLibrary.call(target, data, $(editor));
160 },
161 'beforeSubmit': function (data, form, options) {
162 // Can't use data = [], otherwise we're creating a new array
163 // instead of modifying the existing one.
164 data.splice(0, data.length);
165 }
166 });
167 return false;
168 });
152 Drupal.attachBehaviors($this); 169 Drupal.attachBehaviors($this);
153 } 170 }
154 171
155 // Dynamically compose a callback based on the editor name 172 // Dynamically compose a callback based on the editor name
156 Drupal.behaviors.dndLibrary.attach_library = function(e, data) { 173 Drupal.behaviors.dndLibrary.attach_library = function(e, data) {