mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-11-19 10:58:20 +01:00
fix fullscreen
This commit is contained in:
parent
7911f259b1
commit
1e62eea8ea
@ -1,6 +1,7 @@
|
|||||||
self.OS.GUI =
|
self.OS.GUI =
|
||||||
subwindows: new Object()
|
subwindows: new Object()
|
||||||
dialog: undefined
|
dialog: undefined
|
||||||
|
fullscreen: false
|
||||||
htmlToScheme: (html, app, parent) ->
|
htmlToScheme: (html, app, parent) ->
|
||||||
scheme = $.parseHTML html
|
scheme = $.parseHTML html
|
||||||
($ parent).append scheme
|
($ parent).append scheme
|
||||||
@ -156,12 +157,18 @@ self.OS.GUI =
|
|||||||
app.appmenu = ($ "[data-id = 'appmenu']", "#syspanel")[0]
|
app.appmenu = ($ "[data-id = 'appmenu']", "#syspanel")[0]
|
||||||
app.init()
|
app.init()
|
||||||
|
|
||||||
enterFullscreen: () ->
|
toggleFullscreen: () ->
|
||||||
el = ($ "body")[0]
|
el = ($ "body")[0]
|
||||||
return el.requestFullscreen() if el.requestFullscreen
|
if _GUI.fullscreen
|
||||||
return el.mozRequestFullScreen() if el.mozRequestFullScreen
|
return document.exitFullscreen() if document.exitFullscreen
|
||||||
return el.webkitRequestFullscreen() if el.webkitRequestFullscreen
|
return document.mozCancelFullScreen() if document.mozCancelFullScreen
|
||||||
return el.msRequestFullscreen() if el.msRequestFullscreen
|
return document.webkitExitFullscreen() if document.webkitExitFullscreen
|
||||||
|
return document.exitFullscreen() if document.exitFullscreen
|
||||||
|
else
|
||||||
|
return el.requestFullscreen() if el.requestFullscreen
|
||||||
|
return el.mozRequestFullScreen() if el.mozRequestFullScreen
|
||||||
|
return el.webkitRequestFullscreen() if el.webkitRequestFullscreen
|
||||||
|
return el.msRequestFullscreen() if el.msRequestFullscreen
|
||||||
|
|
||||||
undock: (app) ->
|
undock: (app) ->
|
||||||
($ "#sysdock").get(0).removeapp app
|
($ "#sysdock").get(0).removeapp app
|
||||||
@ -182,6 +189,8 @@ self.OS.GUI =
|
|||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
||||||
initDM: ->
|
initDM: ->
|
||||||
|
($ "body").on 'webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange', ()->
|
||||||
|
_GUI.fullscreen = not _GUI.fullscreen
|
||||||
# check login first
|
# check login first
|
||||||
_API.resource "schemes/dm.html", (x) ->
|
_API.resource "schemes/dm.html", (x) ->
|
||||||
return null unless x
|
return null unless x
|
||||||
@ -317,7 +326,7 @@ self.OS.GUI =
|
|||||||
]
|
]
|
||||||
menu.child = menu.child.concat (v for k, v of _OS.setting.system.menu)
|
menu.child = menu.child.concat (v for k, v of _OS.setting.system.menu)
|
||||||
menu.child.push
|
menu.child.push
|
||||||
text: "Full screen",
|
text: "Toggle Full screen",
|
||||||
dataid: "os-fullsize",
|
dataid: "os-fullsize",
|
||||||
iconclass: "fa fa-tv"
|
iconclass: "fa fa-tv"
|
||||||
menu.child.push
|
menu.child.push
|
||||||
@ -326,7 +335,7 @@ self.OS.GUI =
|
|||||||
iconclass: "fa fa-user-times"
|
iconclass: "fa fa-user-times"
|
||||||
menu.onmenuselect = (d) ->
|
menu.onmenuselect = (d) ->
|
||||||
return _API.handler.logout() if d.item.data.dataid is "sys-logout"
|
return _API.handler.logout() if d.item.data.dataid is "sys-logout"
|
||||||
return _GUI.enterFullscreen() if d.item.data.dataid is "os-fullsize"
|
return _GUI.toggleFullscreen() if d.item.data.dataid is "os-fullsize"
|
||||||
_GUI.launch d.item.data.app unless d.item.data.dataid
|
_GUI.launch d.item.data.app unless d.item.data.dataid
|
||||||
|
|
||||||
($ "[data-id = 'os_menu']", "#syspanel")[0].set "items", [menu]
|
($ "[data-id = 'os_menu']", "#syspanel")[0].set "items", [menu]
|
||||||
|
Loading…
Reference in New Issue
Block a user