rfe 9198: Turn Survey Edit Section/Question/Answer fields into RTEs
This commit is contained in:
parent
3889c937bf
commit
c47a6fb466
4 changed files with 26 additions and 1 deletions
BIN
rfe-9198-root_import_survey_default-answer-edit.wgpkg
Normal file
BIN
rfe-9198-root_import_survey_default-answer-edit.wgpkg
Normal file
Binary file not shown.
BIN
rfe-9198-root_import_survey_default-question-edit.wgpkg
Normal file
BIN
rfe-9198-root_import_survey_default-question-edit.wgpkg
Normal file
Binary file not shown.
BIN
rfe-9198-root_import_survey_default-section-edit.wgpkg
Normal file
BIN
rfe-9198-root_import_survey_default-section-edit.wgpkg
Normal file
Binary file not shown.
|
|
@ -8,8 +8,15 @@ Survey.ObjectTemplate = new function(){
|
||||||
|
|
||||||
document.getElementById('edit').innerHTML = html;
|
document.getElementById('edit').innerHTML = html;
|
||||||
|
|
||||||
|
var myTextarea;
|
||||||
|
|
||||||
|
var handleSubmit = function(){
|
||||||
|
myTextarea.saveHTML();
|
||||||
|
this.submit();
|
||||||
|
}
|
||||||
|
|
||||||
var butts = [
|
var butts = [
|
||||||
{ text:"Submit", handler:function(){this.submit();}, isDefault:true },
|
{ text:"Submit", handler:handleSubmit, isDefault:true },
|
||||||
{ text:"Copy", handler:function(){document.getElementById('copy').value = 1; this.submit();}},
|
{ text:"Copy", handler:function(){document.getElementById('copy').value = 1; this.submit();}},
|
||||||
{ text:"Cancel", handler:function(){this.cancel();}},
|
{ text:"Cancel", handler:function(){this.cancel();}},
|
||||||
{ text:"Delete", handler:function(){document.getElementById('delete').value = 1; this.submit();}}
|
{ text:"Delete", handler:function(){document.getElementById('delete').value = 1; this.submit();}}
|
||||||
|
|
@ -26,6 +33,24 @@ Survey.ObjectTemplate = new function(){
|
||||||
|
|
||||||
form.callback = Survey.Comm.callback;
|
form.callback = Survey.Comm.callback;
|
||||||
form.render();
|
form.render();
|
||||||
|
|
||||||
|
var textareaId = type+'Text';
|
||||||
|
var textarea = YAHOO.util.Dom.get(textareaId);
|
||||||
|
var height = YAHOO.util.Dom.getStyle(textarea,'height');
|
||||||
|
if (height == ''){
|
||||||
|
height = '300px';
|
||||||
|
}
|
||||||
|
var width = YAHOO.util.Dom.getStyle(textarea,'width');
|
||||||
|
if (width == ''){
|
||||||
|
width = '500px';
|
||||||
|
}
|
||||||
|
myTextarea = new YAHOO.widget.SimpleEditor(textareaId, {
|
||||||
|
height: height,
|
||||||
|
width: width,
|
||||||
|
dompath: false //Turns on the bar at the bottom
|
||||||
|
});
|
||||||
|
myTextarea.render();
|
||||||
|
|
||||||
form.show();
|
form.show();
|
||||||
}
|
}
|
||||||
}();
|
}();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue