Browse Source

add onfullscreen & onfullscreenExit event handle

mathjax-version
Pandao 10 years ago
parent
commit
4a6fd3b7d7
  1. 15
      dist/js/editormd.js
  2. 2
      dist/js/editormd.min.js

15
dist/js/editormd.js

@ -65,6 +65,8 @@
watch : true, watch : true,
onload : function() {}, onload : function() {},
onchange : function() {}, onchange : function() {},
onfullscreen : function() {},
onfullscreenExit : function() {},
toc : true, toc : true,
tocStartLevel : 2, tocStartLevel : 2,
fontSize : "13px", fontSize : "13px",
@ -1294,14 +1296,15 @@
border : "none", border : "none",
width : $(window).width(), width : $(window).width(),
height : $(window).height() height : $(window).height()
}).addClass(fullscreenClass);
}).addClass(fullscreenClass);
this.resize();
$.proxy(this.settings.onfullscreen, this)();
} }
else else
{ {
this.fullscreenExit();
}
this.resize();
this.fullscreenExit();
}
$(window).keyup(function(event) { $(window).keyup(function(event) {
if (_this.state.preview) { if (_this.state.preview) {
@ -1342,6 +1345,8 @@
}).removeClass(fullscreenClass); }).removeClass(fullscreenClass);
this.resize(); this.resize();
$.proxy(this.settings.onfullscreenExit, this)();
return this; return this;
} }

2
dist/js/editormd.min.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save