mirror of
https://github.com/lxsang/antos-frontend.git
synced 2025-07-21 00:09:45 +02:00
fix system & context menu
This commit is contained in:
@ -247,7 +247,7 @@ self.OS.GUI =
|
||||
{ text: "Open", dataid: "desktop-open" },
|
||||
{ text: "Refresh", dataid: "desktop-refresh" }
|
||||
]
|
||||
menu = menu.concat _OS.setting.desktop.menu
|
||||
menu = menu.concat ( v for k, v of _OS.setting.desktop.menu)
|
||||
m.set "items", menu
|
||||
m.set "onmenuselect", (evt) ->
|
||||
switch evt.item.data.dataid
|
||||
@ -260,7 +260,7 @@ self.OS.GUI =
|
||||
when "desktop-refresh"
|
||||
desktop[0].fetch()
|
||||
else
|
||||
_GUI.launch evt.item.data.app if evt.item.data.app
|
||||
_GUI.launch evt.item.data.app, evt.item.data.args if evt.item.data.app
|
||||
m.show(e)
|
||||
|
||||
desktop[0].fetch()
|
||||
@ -290,7 +290,7 @@ self.OS.GUI =
|
||||
_GUI.launch d.item.data.app
|
||||
}
|
||||
]
|
||||
menu.child = menu.child.concat _OS.setting.system.menu
|
||||
menu.child = menu.child.concat (v for k, v of _OS.setting.system.menu)
|
||||
menu.child.push
|
||||
text: "Log out",
|
||||
dataid: "sys-logout",
|
||||
@ -329,7 +329,7 @@ self.OS.GUI =
|
||||
_OS.setting.user = conf.user
|
||||
_OS.setting.VFS = conf.VFS if conf.VFS
|
||||
_OS.setting.desktop.path = "home:///.desktop" unless _OS.setting.desktop.path
|
||||
_OS.setting.desktop.menu = [] unless _OS.setting.desktop.menu
|
||||
_OS.setting.desktop.menu = {} unless _OS.setting.desktop.menu
|
||||
_OS.setting.VFS.mountpoints = [
|
||||
#TODO: multi app try to write to this object, it neet to be cloned
|
||||
{ text: "Applications", path: 'app:///', iconclass: "fa fa-adn", type: "app" },
|
||||
@ -343,7 +343,7 @@ self.OS.GUI =
|
||||
"home:///.packages",
|
||||
"os:///packages"
|
||||
] unless _OS.setting.system.pkgpaths
|
||||
_OS.setting.system.menu = [] unless _OS.setting.system.menu
|
||||
_OS.setting.system.menu = {} unless _OS.setting.system.menu
|
||||
|
||||
_OS.setting.appearance.theme = "antos" unless _OS.setting.appearance.theme
|
||||
# load theme
|
||||
@ -367,7 +367,7 @@ self.OS.GUI =
|
||||
_GUI.pushServices [
|
||||
"CoreServices/PushNotification",
|
||||
"CoreServices/Spotlight",
|
||||
"CoreServices/Calendar"
|
||||
#"CoreServices/Calendar"
|
||||
]
|
||||
|
||||
# startup application here
|
||||
|
@ -6,4 +6,4 @@
|
||||
<afx-float-list id = "desktop" ></afx-float-list>
|
||||
<!--div id = "workingenv"></div-->
|
||||
</div>
|
||||
<afx-menu id="contextmenu" context="true" style="display:none;"></afx-menu>
|
||||
<afx-menu id="contextmenu" data-id="contextmenu" context="true" style="display:none;"></afx-menu>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<afx-menu >
|
||||
<ul class={context: opts.context == "true"}>
|
||||
<li class="afx-corner-fix"></li>
|
||||
<li ref = "container" each={ data,i in items } class = {afx_submenu:data.child != null, fix_padding:data.icon} no-reorder>
|
||||
<li ref = "container" each={ data,i in items } class = {afx_submenu:data.child != null && data.child.length > 0, fix_padding:data.icon} no-reorder>
|
||||
<a href="#" onclick = {parent.onselect}>
|
||||
<afx-switch if = {data.switch || data.radio} class = {checked:parent.checkItem(data)} enable = false swon = {data.checked} ></afx-switch>
|
||||
<afx-label color = {data.color} iconclass = {data.iconclass} icon = {data.icon} text = {data.text} ></afx-label>
|
||||
</a>
|
||||
|
||||
<afx-menu if={data.child != null} child={data.child.constructor === Array?data.child:data.child()} onmenuselect = {data.onmenuselect} observable = {parent.root.observable} rootid = {parent.rid}></afx-menu>
|
||||
<afx-menu if={data.child != null && data.child.length > 0} child={data.child} onmenuselect = {data.onmenuselect} observable = {parent.root.observable} rootid = {parent.rid}></afx-menu>
|
||||
</li>
|
||||
<li class="afx-corner-fix"></li>
|
||||
</ul>
|
||||
@ -78,7 +78,7 @@
|
||||
self.root.show = function(e)
|
||||
{
|
||||
//only for menucontext
|
||||
if(opts.context != "true") return;
|
||||
if(opts.context != "true") return
|
||||
$(self.root)
|
||||
.css("top", e.clientY - 15 + "px")
|
||||
.css("left",e.clientX -5 + "px")
|
||||
|
@ -96,7 +96,7 @@
|
||||
self.update()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
select(event)
|
||||
{
|
||||
if(istoggle)
|
||||
|
Reference in New Issue
Block a user