thomaspink / ng-storyblok

Full Storyblok integration in Angular 2
MIT License
8 stars 1 forks source link

add editing mode for storyblok integration #11

Open thomaspink opened 8 years ago

thomaspink commented 8 years ago
pingEditor: function (cb) {
  if (window.location != window.parent.location) {
    window.parent.postMessage({
      action: 'ping'
    }, this.parent())
  } else {
    this.inEditor = false
    cb(this)
  }

  this.on('pingBack', function () {
    this.inEditor = true
    cb(this)
  }.bind(this))
}

events: {
  'change': [],
  'published': [],
  'unpublished': [],
  'viewLiveVersion': [],
  'enterEditmode': [],
  'pingBack': [] // THIS ONE
},