Skip to content
Browse files

MINOR Fixed ajax load binding to folder selection in ThumbnailStripFi…

…eld.js (was broken after move to jquery)
  • Loading branch information...
1 parent cfea011 commit 49a76a0c9505504004bfa2b08fdbebe7e15ef866 @chillu chillu committed Mar 22, 2011
Showing with 6 additions and 5 deletions.
  1. +6 −5 javascript/ThumbnailStripField.js
View
11 javascript/ThumbnailStripField.js
@@ -21,17 +21,18 @@ ThumbnailStripField.prototype = {
updateMethod: 'getimages',
initialize: function() {
+ var self = this;
+
try {
this.updateMethod = this.className.match(/updatemethod=([^ ]+)/)[1];
} catch(err) {}
if(this.className.match(/parent=([^ ]+)/)) {
// HACK: This is hard-coded to only work with TreeDropdownFields
- var parentField = $(RegExp.$1).parentNode;
- if(parentField) {
- // TODO Fix observing in IE7/IE8
- // parentField.observeMethod('Change', this.ajaxGetFiles.bind(this));
- }
+ var inputField = $(RegExp.$1), parentField = inputField.parentNode;
+ if(parentField) jQuery(parentField).bind('change', function() {
+ self.ajaxGetFiles(jQuery(inputField).val());
+ });
var searchField = $$('#' + this.updateMethod + 'Search input')[0];
var timeout = undefined;

0 comments on commit 49a76a0

Please sign in to comment.
Something went wrong with that request. Please try again.