Commit 8fb8d508 authored by jan.koester's avatar jan.koester
Browse files

tetst

parent ca5f89ac
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -759,11 +759,24 @@ var SurveyManager = (function() {
            return;
        }
        var statusEl = el('sm-publish-status');
        statusEl.textContent = 'Verbinde…';
        statusEl.textContent = 'Speichere…';
        statusEl.className = 'set-status';

        // Connect first, then publish
        EditorApi.connectToConnection(connId).then(function() {
        // Commit any unsaved question-editor changes into memory first
        if (_editingQ) saveCurrentQuestion();

        // Explicitly flush current in-memory state to DB before publishing to
        // avoid a race with the async autoSaveXml() that saveCurrentQuestion fires.
        var xml = questionsToXml(_current.name || '', _current.title || '', _current.questions || []);
        EditorApi.saveSurvey({
            id: _current.id,
            name: _current.name || '',
            title: _current.title || '',
            xml: xml
        }).then(function() {
            statusEl.textContent = 'Verbinde…';
            return EditorApi.connectToConnection(connId);
        }).then(function() {
            statusEl.textContent = 'Umfrage wird übertragen…';
            return EditorApi.publishSurvey(_current.id, connId);
        }).then(function(resp) {
+1 −1
Original line number Diff line number Diff line
@@ -1768,7 +1768,7 @@ namespace blogi {
                 << "var list=imageData[fileInput.name];if(!list||list.length===0){err.classList.add('show');return false;}}"
                 << "err.classList.remove('show');return true;}"
                 // wizard nav
                 << "function wizardNext(){if(!validateStep(currentStep))return;var nxt=nextVisibleStep(currentStep);if(nxt!==-1)showStep(nxt);}"
                 << "function wizardNext(){if(!validateStep(currentStep))return;var nxt=nextVisibleStep(currentStep);if(nxt!==-1)showStep(nxt);else submitSurvey();}"
                 << "function wizardPrev(){var prv=prevVisibleStep(currentStep);if(prv!==-1)showStep(prv);}"
                 // image upload helpers
                 << "function ensureImageList(name){if(!imageData[name])imageData[name]=[];return imageData[name];}"