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 }>
<button disabled={ enable == false } onclick="{ _onbtclick }" ref = "mybtn" >
<afx-button >
<button class= { btactive: selected } disabled={ enable == false } onclick="{ _onbtclick }" ref = "mybtn" >
<afx-label color = {color} icon={icon} iconclass = {iconclass} text = {text} ></afx-label>
</button>
<script>

View File

@ -284,16 +284,29 @@ class AntOSDK extends this.OS.GUI.BaseApplication
me = @
me.prjfile = file
if(me.tabarea)
file.read (d) ->
file.read (data) ->
me.log "INFO", __("Opening {0}", me.prjfile.path)
me.tabarea.set "selected", -1
me.tabarea.set "items", []
me.currfile = "#{d.root}/README.md".asFileHandler()
me.currfile.dirty = false
me.chdir d.root if d.root
me.prjfile.cache = d
me.log "INFO", __("Opening {0}", me.currfile.path)
me.open me.currfile
fn = (d, dt) ->
me.tabarea.set "selected", -1
me.tabarea.set "items", []
me.currfile = "#{d.root}/README.md".asFileHandler()
me.currfile.dirty = dt
me.chdir d.root if d.root
me.prjfile.cache = d
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"
else
me.init()

View File

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