I have a Backbone view with a button that should make the view goto fullscreen on click. I'm using screenfull.js, and I cant see any different from the examples and my code. But console.log(screenfull.enabled);
always return false
in the clickHandler.
var FullScreenButton = Backbone.Marionette.ItemView.extend({
tagName: 'button',
initialize: function () {
this.$el.click(_.bind(this.goFullScreen, this));
},
goFullScreen: function () {
console.log(screenfull.enabled);
screenfull.request(this.options.container);
}
});
also without screenfull.js it dont g oto fullscreen:
goFullScreen: function() {
var element = document.documentElement;
if (element.requestFullScreen) {
element.requestFullScreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
}
}