Changeset 29255 for trunk/plugins/AdminTools/template/public_controller.js
- Timestamp:
- Aug 23, 2014, 1:47:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/AdminTools/template/public_controller.js
r26603 r29255 242 242 // try to find background color matching text color 243 243 // there is a 1s delay to wait for jQuery Mobile initialization 244 setTimeout(function() {244 function bgColor() { 245 245 var bg_color = 'white'; 246 246 var selectors = ['#the_page #content', '[data-role="page"]', 'body']; … … 255 255 256 256 $ato_edit.css('background-color', bg_color); 257 } , 1000);257 } 258 258 259 259 $ato_edit.find('.close-edit').on('click', function(e) { … … 261 261 e.preventDefault(); 262 262 }); 263 264 if (is_picture) {265 $ato_edit.find('.datepicker').datepicker({266 dateFormat: 'yy-mm-dd'267 });268 }269 263 270 264 $(".edit-quick").colorbox({ … … 276 270 title: $ato_edit.attr('title'), 277 271 272 onComplete: function() { 273 setTimeout(function() { 274 $('#quick_edit_name').focus(); 275 }, 0); 276 }, 277 278 278 onOpen: function() { 279 if (!is_picture) return; 280 281 // fetch tags list on first open 282 if ($(this).data('tags-init')) return; 283 284 $.ajax({ 285 method: 'POST', 286 url: __this.urlWS + 'pwg.tags.getList', 287 dataType: 'json', 288 success: function(data) { 289 var tags = []; 290 // convert to custom format 291 for (var i=0, l=data.result.tags.length; i<l; i++) { 292 tags.push({ 293 id: '~~'+ data.result.tags[i].id +'~~', 294 name: data.result.tags[i].name 295 }); 279 bgColor(); 280 281 if (is_picture) { 282 $ato_edit.find('.datepicker').datepicker({ 283 dateFormat: 'yy-mm-dd' 284 }); 285 286 // fetch tags list on first open 287 if ($(this).data('tags-init')) return; 288 289 $.ajax({ 290 method: 'POST', 291 url: __this.urlWS + 'pwg.tags.getList', 292 dataType: 'json', 293 success: function(data) { 294 var tags = []; 295 // convert to custom format 296 for (var i=0, l=data.result.tags.length; i<l; i++) { 297 tags.push({ 298 id: '~~'+ data.result.tags[i].id +'~~', 299 name: data.result.tags[i].name 300 }); 301 } 302 303 $ato_edit.find('.tags').tokenInput( 304 tags, 305 $.extend({ 306 animateDropdown: false, 307 preventDuplicates: true, 308 allowFreeTagging: true 309 }, tokeninput_lang) 310 ); 311 312 $.colorbox.resize(); 313 $(this).data('tags-init', true); 314 }, 315 error: function(xhr, text, error) { 316 alert(text + ' ' + error); 296 317 } 297 298 $ato_edit.find('.tags').tokenInput( 299 tags, 300 $.extend({ 301 animateDropdown: false, 302 preventDuplicates: true, 303 allowFreeTagging: true 304 }, tokeninput_lang) 305 ); 306 307 $.colorbox.resize(); 308 $(this).data('tags-init', true); 309 }, 310 error: function(xhr, text, error) { 311 alert(text + ' ' + error); 312 } 313 }); 314 } 318 }); 319 } 320 } 321 }); 322 323 // Ctrl+E opens the quick edit 324 Mousetrap.bind('mod+e', function(e) { 325 e.preventDefault(); 326 $(".edit-quick").click(); 315 327 }); 316 328 };
Note: See TracChangeset
for help on using the changeset viewer.