Skip to content

Commit

Permalink
Merge pull request #97 from acrobat/regression-fix
Browse files Browse the repository at this point in the history
fixes for regression after #72
  • Loading branch information
toopay committed Aug 29, 2014
2 parents 509d154 + 71089eb commit 906a6d7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions js/bootstrap-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@
this.$editor.on('click', '[data-provider="bootstrap-markdown"]', $.proxy(this.__handle, this))

if (this.$element.is(':disabled') || this.$element.is('[readonly]')) {
this.$editor.addClass('md-editor-disabled');
this.disableButtons('all');
}

Expand All @@ -359,6 +360,10 @@
})
}

if (options.initialstate === 'preview') {
this.showPreview();
}

} else {
this.$editor.show()
}
Expand All @@ -368,10 +373,6 @@
this.$editor.addClass('active')
}

if (options.initialstate === 'preview') {
this.showPreview();
}

// hide hidden buttons from options
this.hideButtons(options.hiddenButtons)

Expand Down Expand Up @@ -447,6 +448,11 @@
// Attach the editor instances
replacementContainer.data('markdown',this)

if (this.$element.is(':disabled') || this.$element.is('[readonly]')) {
this.$editor.addClass('md-editor-disabled');
this.disableButtons('all');
}

return this
}

Expand Down

0 comments on commit 906a6d7

Please sign in to comment.