mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-01-18 01:27:25 +01:00
git-svn-id: https://andors-trail.googlecode.com/svn/trunk@72 08aca716-68be-ccc6-4d58-36f5abd142ac
22 lines
582 B
JavaScript
22 lines
582 B
JavaScript
|
|
function createQuestEditor(obj) {
|
|
var div = $( "#templates #editQuest" ).clone(true);
|
|
applyCommonEditorBindings(div, obj, model.quests);
|
|
if (!obj.stages) obj.stages = [];
|
|
var array = obj.stages;
|
|
var createNewStage = function() {
|
|
var nextProgress;
|
|
if (array.length > 0) { nextProgress = parseInt(array[array.length - 1].progress) + 10; }
|
|
if (!nextProgress) { nextProgress = 10; }
|
|
return { progress: nextProgress };
|
|
};
|
|
applyTableEditor({
|
|
table: $( "#stages", div ),
|
|
dialog: questlogDialog,
|
|
array: array,
|
|
templateFunction: createNewStage
|
|
});
|
|
return div;
|
|
}
|
|
|