Skip to content

Commit aa111ee

Browse files
committed
Fix #109
1 parent 846fb30 commit aa111ee

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

js/bootstrap-markdown.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,22 @@
2525
* ========================== */
2626

2727
var Markdown = function (element, options) {
28+
// @TODO : remove this BC on next major release
29+
// @see : https://github.com/toopay/bootstrap-markdown/issues/109
30+
var opts = ['autofocus', 'savable', 'hideable', 'width', 'height', 'resize',
31+
'language', 'footer', 'fullscreen', 'hiddenButtons', 'disabledButton'];
32+
$.each(opts,function(_, opt){
33+
if (typeof $(element).data(opt) !== 'undefined') {
34+
options[opt] = $(element).data(opt)
35+
}
36+
});
37+
// End BC
38+
2839
// Class Properties
2940
this.$ns = 'bootstrap-markdown';
3041
this.$element = $(element);
3142
this.$editable = {el:null, type:null,attrKeys:[], attrValues:[], content:null};
32-
this.$options = $.extend(true, {}, $.fn.markdown.defaults, options, this.$element.data(), this.$element.data('options'));
43+
this.$options = $.extend(true, {}, $.fn.markdown.defaults, options, this.$element.data('options'));
3344
this.$oldContent = null;
3445
this.$isPreview = false;
3546
this.$isFullscreen = false;

0 commit comments

Comments
 (0)