fix menu bug

This commit is contained in:
Xuan Sang LE 2018-03-10 23:16:48 +01:00
parent 702a83df6a
commit 7fefc17f04
3 changed files with 27 additions and 3 deletions

View File

@ -54,7 +54,7 @@ class BasicDialog extends BaseDialog
init: () ->
@title = @name if not @title
html = "<afx-app-window data-id = 'dia-window' apptitle='#{@title}' width='#{@conf.width}' height='#{@conf.height}'>
html = "<afx-app-window data-id = 'dia-window' width='#{@conf.width}' height='#{@conf.height}'>
<afx-vbox>"
html += "<#{v.tag} #{v.att} style = 'margin-left:5px; margin-right:5px;' data-id = 'content#{k}'></#{v.tag}>" for k,v of @conf.tags
html += "<div data-height = '35' style=' text-align:right;padding-top:3px;'>"
@ -64,6 +64,7 @@ class BasicDialog extends BaseDialog
_GUI.htmlToScheme html, @, @host
main: () ->
@scheme.set "apptitle", @title
@scheme.set "minimizable", false
@scheme.set "resizable", @conf.resizable if @conf.resizable isnt undefined
me = @
@ -266,7 +267,7 @@ class FileDiaLog extends BaseDialog
location = @find "location"
filename = @find "filename"
me = @
@scheme.set "apptitle", "#{@title}"
@scheme.set "apptitle", @title
fileview.set "fetch", (e, f) ->
return unless e.child
e.child.path.asFileHandler().read (d) ->

View File

@ -0,0 +1,20 @@
<afx-html ref = "container">
<script>
this.content = opts.content
this.root.innerHTML = this.content
this.updateContent = undefined
var self = this
this.root.set = function(k, v)
{
self[k] = v
if(k == "content")
self.root.innerHTML = v
else if(k == "updateContent")
self.update()
}
this.on("update", function(){
if(self.updateContent)
self.updateContent()
})
</script>
</afx-html>

View File

@ -18,8 +18,11 @@ afx-menu a afx-label{
afx-menu ul{
padding:0;
margin: 0;
display:inline-block;
}
afx-menu ul li{
white-space:nowrap;
}
afx-menu afx-switch span{
width: 20px;
height: 16px;