Changeset 240 for Dev/branches/jos-branch/js/questionEditorScripts.js
- Timestamp:
- 01/18/12 17:13:25 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/jos-branch/js/questionEditorScripts.js
r238 r240 24 24 // Properties 25 25 this.uid = null; // The uid of the question contained in this editor 26 this.saved = false; // Whether or not the question displayed in the editor has been saved already.27 26 var me = this; // Retarded self-reference because: Javascript 28 27 this.element = null; // The parent div element containing the questionEditor … … 72 71 } 73 72 } 74 this.init = function( ) {73 this.init = function(uid) { 75 74 // Outer div 76 75 this.saved = false; … … 78 77 me.element.className = "smallFrame questionEditor"; 79 78 me.element.id = sequencer.state.selectedObject.uid; 80 me.uid = sequencer.state.selectedObject.uid;79 me.uid = uid; 81 80 // Header 82 81 var titleDiv = ce("div"); … … 176 175 "title": ge("qeTitleField").innerHTML, 177 176 "code": ge("qeCodeField").value, 178 "description": ge("qeBodyTextField").value 177 "description": ge("qeBodyTextField").value, 178 "uid": me.uid 179 179 } 180 180 … … 221 221 // Then add the returned uid, if existing, to the sequencer.survey.questions array and set it for update 222 222 debugger; 223 console.log(result.responseText); 223 224 var response = JSON.parse(result.responseText); 224 225 console.log(response); … … 250 251 } 251 252 this.discard = function() { 252 debugger; 253 me.element.parentNode.removeChild(me.element); 254 me.init(); 255 sequencer.state.loaded = true; 256 sequencer.state.editing = false; 257 sequencer.survey.questions.upToDate[sequencer.survey.questions.uids.indexOf(me.uid)] = false; 258 updateSequencer(); 253 debugger; 254 me.element.parentNode.removeChild(me.element); 255 sequencer.state.loaded = true; 256 sequencer.state.editing = false; 257 sequencer.survey.questions.upToDate[sequencer.survey.questions.uids.indexOf(me.uid)] = false; 258 updateSequencer(); 259 259 260 260 } … … 476 476 uid: uid 477 477 }); 478 me.init( );478 me.init(uid); 479 479 var oldElement = ge(uid); 480 480 if (oldElement) { … … 494 494 sequencer.state.editing = true; 495 495 496 me. reset();496 me.init(null); 497 497 var container = ge("seqContentWrapper"); 498 498 container.appendChild(me.element);
Note: See TracChangeset
for help on using the changeset viewer.