Changeset 32853 for main/trunk
- Timestamp:
- 2019-03-04T21:57:57+13:00 (5 years ago)
- Location:
- main/trunk/greenstone3/web/interfaces/default/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/js/documentedit_scripts.js
r32852 r32853 233 233 mapGPScontainer.css("display", "none"); 234 234 235 addFunctionalityToTable(mapGPScontainer); // **********************************236 mapGPScontainer.metaNameField.css("display", "none");237 mapGPScontainer.addRowButton.css("display", "none");238 if (enable_add_all_metadata_button == true) {239 mapGPScontainer.addAllButton.css("display", "none");240 }241 242 235 } 243 236 … … 290 283 function readyPageForEditing() { 291 284 292 // CKEDITOR.on('instanceReady', function(evt) {293 // addCKEEditableState(evt,editableInitStates);294 // });295 296 285 if ($("#metadataSetList").length) { 297 286 var setList = $("#metadataSetList"); … … 307 296 //wait for 0.5 sec to let ckeditor up 308 297 309 // The following is now done in the CKEDTIOR.on('instanceReady') handler, which is added when docReady, see documentedit_scripts_util::$( document ).ready(...)310 // Attempting CKED TIOR.on('instanceReady') at the start ofthis method didn't work because it was probably too late in page load phase to add the event handler then298 // Initialising editableInitStates for CKEDITOR instances now happens in the CKEDITOR.on('instanceReady') handler, which is added upon docReady, see documentedit_scripts_util::$( document ).ready(...) 299 // Attempting CKEDITOR.on('instanceReady') at the start of this method or anywhere in this method didn't work because it was probably too late in page load phase to add the event handler then 311 300 // (the instanceReady() event would have been triggered before this method finally got called). 312 /* 313 setTimeout(function () { 314 $(".sectionText").each(function () { 315 addEditableState(this, editableInitStates); 316 }); 317 }, 500); 318 */ 301 319 302 var editBar = $("#editBarLeft"); 320 303 … … 380 363 // We need to keep track of editableElementsInitialisationProgress: the number of editable elements that need to be initialised/need to finish initialising 381 364 // As CKEditors will be added, meaning more editable elements, must increment our counter editableElementsInitialisationProgress 382 var $num_editable_textareas = $(".sectionText"); // consider searching for 'contenteditable="true"' as this is what CKEDITOR is looking for (we think!) 365 //var $num_editable_textareas = $(".sectionText"); // consider searching for 'contenteditable="true"' as this is what CKEDITOR is looking for (we think!) 366 // I think for us it's always a <div> that has contenteditable="true", but to get all elements with attr contenteditable set to true, 367 // see https://stackoverflow.com/questions/4958081/find-all-elements-with-a-certain-attribute-value-in-jquery 368 // which has inefficient and slightly more efficient ways of doing that 369 var $num_editable_textareas = $('div[contenteditable="true"]'); 383 370 editableElementsInitialisationProgress += $num_editable_textareas.length; 384 371 -
main/trunk/greenstone3/web/interfaces/default/js/documentedit_scripts_util.js
r32852 r32853 945 945 } 946 946 947 function addFunctionalityToMapGPS(mapGPScontainer)948 {949 950 }951 952 947 function addFunctionalityToTable(table) 953 948 { … … 1013 1008 1014 1009 // add metadata field selector 1015 1010 var metaNameField = createMetadataElementSelector(); 1016 1011 table.after(metaNameField); 1017 1012 table.metaNameField = metaNameField;
Note:
See TracChangeset
for help on using the changeset viewer.