Plugin Directory

Changeset 1845091


Ignore:
Timestamp:
03/22/2018 02:02:32 PM (8 years ago)
Author:
playbuzz
Message:

fix - preview button will display the playbuzz item

Location:
playbuzz/trunk/js/story-creator
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • playbuzz/trunk/js/story-creator/pb-story-creator-controller.js

    r1845084 r1845091  
    4646
    4747        //_this.model.savePost(sender.wp).then(_this.postSuccessHandler.bind(_this), _this.errorHandler.bind(_this));
    48         _this.model.previewPost(sender.wp).then(_this.postSuccessHandler.bind(_this), _this.errorHandler.bind(_this));
     48        _this.model.previewPost(sender.wp).then(_this.refreshCreator.bind(_this), _this.errorHandler.bind(_this));
    4949
    5050    });
  • playbuzz/trunk/js/story-creator/pb-story-creator-model.js

    r1845084 r1845091  
    4545 * 3. perform given action (save/ publish) via wordpress
    4646 * @param action
    47  * @param actionOnWP
     47 * @param wpOriginalElement
    4848 * @returns {Promise}
    4949 */
    50 PbStoryCreatorModel.prototype.performAction = function (action, actionOnWP, paramsToAction) {
     50PbStoryCreatorModel.prototype.performAction = function (action, wpOriginalElement, paramsToAction) {
    5151
    5252    var _this = this;
     
    7171        .then(function (res) {
    7272
    73             actionOnWP.click();
     73            wpOriginalElement.click();
    7474            deferred.resolve(res);
    7575        })
     
    107107PbStoryCreatorModel.prototype.savePost = function (saveButton) {
    108108
    109     return this.performAction(this.pbCreator.save, saveButton);
     109    return this.performAction(this.pbCreator.publish, saveButton);
    110110
    111111};
     
    120120    var redirect = true;
    121121
    122     return this.performAction(this.pbCreator.save , previewButton, redirect);
     122    return this.performAction(this.pbCreator.publish , previewButton, redirect);
    123123
    124124};
Note: See TracChangeset for help on using the changeset viewer.