Skip to content

Commit

Permalink
Merge pull request #1551 from mcsekar12/dev. Closes #1526
Browse files Browse the repository at this point in the history
Fullscreen command with a target
  • Loading branch information
artf committed Nov 3, 2018
2 parents 72be9b5 + 146c1e7 commit 9c0652c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/commands/view/Fullscreen.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isElement } from 'underscore';
module.exports = {
/**
* Check if fullscreen mode is enabled
Expand All @@ -20,6 +21,7 @@ module.exports = {
* @return {string}
*/
enable(el) {
debugger;
var pfx = '';
if (el.requestFullscreen) el.requestFullscreen();
else if (el.webkitRequestFullscreen) {
Expand Down Expand Up @@ -59,9 +61,12 @@ module.exports = {
}
},

run(editor, sender) {
run(editor, sender, opts = {}) {
this.sender = sender;
var pfx = this.enable(editor.getContainer());
var target = isElement(opts.target)
? els
: document.querySelector(opts.target);
var pfx = this.enable(target || editor.getContainer());
this.fsChanged = this.fsChanged.bind(this, pfx);
document.addEventListener(pfx + 'fullscreenchange', this.fsChanged);
if (editor) editor.trigger('change:canvasOffset');
Expand Down

0 comments on commit 9c0652c

Please sign in to comment.