This commit is contained in:
lxsang 2018-09-13 21:41:14 +02:00
parent aec5457a31
commit 5b6e68116b
3 changed files with 25 additions and 12 deletions

View File

@ -1,5 +1,5 @@
<afx-button class= { btactive: selected }> <afx-button >
<button disabled={ enable == false } onclick="{ _onbtclick }" ref = "mybtn" > <button class= { btactive: selected } disabled={ enable == false } onclick="{ _onbtclick }" ref = "mybtn" >
<afx-label color = {color} icon={icon} iconclass = {iconclass} text = {text} ></afx-label> <afx-label color = {color} icon={icon} iconclass = {iconclass} text = {text} ></afx-label>
</button> </button>
<script> <script>

View File

@ -284,16 +284,29 @@ class AntOSDK extends this.OS.GUI.BaseApplication
me = @ me = @
me.prjfile = file me.prjfile = file
if(me.tabarea) if(me.tabarea)
file.read (d) -> file.read (data) ->
me.log "INFO", __("Opening {0}", me.prjfile.path) me.log "INFO", __("Opening {0}", me.prjfile.path)
me.tabarea.set "selected", -1 fn = (d, dt) ->
me.tabarea.set "items", [] me.tabarea.set "selected", -1
me.currfile = "#{d.root}/README.md".asFileHandler() me.tabarea.set "items", []
me.currfile.dirty = false me.currfile = "#{d.root}/README.md".asFileHandler()
me.chdir d.root if d.root me.currfile.dirty = dt
me.prjfile.cache = d me.chdir d.root if d.root
me.log "INFO", __("Opening {0}", me.currfile.path) me.prjfile.cache = d
me.open me.currfile me.log "INFO", __("Opening {0}", me.currfile.path)
me.open me.currfile
# verify if the path is ok
data.root.asFileHandler().onready () ->
fn(data, false)
, (e) ->
# try the current folder of the project file
pr = file.parent()
me.log "INFO", __("Project root folder not found, try {0}", pr)
pr.asFileHandler().onready () ->
data.root = pr
fn(data, true)
, (e) ->
me.error __("Cannot find the project root, please modify the project file")
,"json" ,"json"
else else
me.init() me.init()

View File

@ -18,7 +18,7 @@ afx-button i.icon-style {
display: inline-block; display: inline-block;
float:left; float:left;
} }
afx-button button:active, afx-button.btactive button { afx-button button:active, afx-button button.btactive {
background-color: #2786F3; background-color: #2786F3;
color: white; color: white;
border: 1px solid #dedede; border: 1px solid #dedede;