Changeset 2165 for plugins/apostrophePlugin/trunk/web/js
- Timestamp:
- 09/09/10 12:28:23 (21 months ago)
- Location:
- plugins/apostrophePlugin/trunk/web/js
- Files:
-
- 2 modified
-
. (modified) (1 prop)
-
aControls.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/apostrophePlugin/trunk/web/js
-
Property
svn:mergeinfo set
to
(toggle deleted branches)
/plugins/apostrophePlugin/branches/1.3/web/js merged eligible /plugins/apostrophePlugin/branches/1.4/web/js merged eligible /plugins/apostrophePlugin/branches/features/cropping/web/js merged eligible /plugins/apostrophePlugin/branches/features/wjohnald/web/js merged eligible /plugins/apostrophePlugin/branches/admin-bar-lab/web/js 972-1485 /plugins/apostrophePlugin/branches/ajaxeditview/web/js 1376 /plugins/apostrophePlugin/branches/cropping/web/js 1470-1489 /plugins/apostrophePlugin/branches/features/admin-bar-lab/web/js 1486-1535 /plugins/apostrophePlugin/branches/simplemedia/web/js 110-174
-
Property
svn:mergeinfo set
to
(toggle deleted branches)
-
plugins/apostrophePlugin/trunk/web/js/aControls.js
r2082 r2165 71 71 options = {}; 72 72 } 73 $(target + ' select[multiple]').each( 73 74 $(target).find('select[multiple]').each( 74 75 function(i) { 75 76 var name = $(this).attr('name'); … … 127 128 if (id === '') 128 129 { 129 // Hopefully unique130 id = name;130 // We need a unique ID for the element, give it one 131 id = 'a_id_' + Math.floor(Math.random() * 1000000000); 131 132 } 132 133 var html = "<div class='a-multiple-select' id='" + id + "'>"; … … 152 153 { 153 154 html += "<input type='checkbox' name='" + name + "'"; 155 156 if (options['class-name'] !== undefined) 157 { 158 html += "class='" + options['class-name'] + "'"; 159 } 160 154 161 if (selected[j]) 155 162 { … … 219 226 $(items[k]).click(function() { update($(this).data("boxid"), false); return false; }); 220 227 } 228 229 221 230 function update(remove, initial) 222 231 { … … 236 245 value = select.options[index].value; 237 246 } 247 238 248 var boxes = $('#' + id + " input[type=checkbox]"); 239 for (k = 1; (k < length); k++) 240 { 241 if (boxes[k].value === remove) 242 { 243 boxes[k].checked = false; 244 } 245 if (boxes[k].value === value) 246 { 247 boxes[k].checked = true; 248 } 249 } 249 250 boxes.each(function() 251 { 252 if ($(this).val() === remove) 253 { 254 $(this).attr('checked', false); 255 } 256 else if ($(this).val() === value) 257 { 258 $(this).attr('checked', true); 259 } 260 }); 261 250 262 var items = $('#' + id + ' ul li'); 251 263 var k; … … 253 265 for (k = 0; (k < length); k++) 254 266 { 255 if ( boxes[k].checked)267 if ($(boxes[k]).is(':checked')) 256 268 { 257 269 $(items[k]).show();

