fix minor error

This commit is contained in:
Xuan Sang LE
2018-01-30 19:06:30 +01:00
parent 02422319ca
commit de387ece25
23 changed files with 190 additions and 95 deletions

View File

@ -215,7 +215,17 @@ class NotePad extends this.OS.GUI.BaseApplication
when "#{@name}-Saveas"
@currfile.cache = @editor.getValue()
saveas()
cleanup: (evt) ->
dirties = ( v for v in @tabarea.get "items" when v.dirty )
return if dirties.length is 0
me = @
evt.preventDefault()
@.openDialog "YesNoDialog", (d) ->
if d
v.dirty = false for v in dirties
me.quit()
, "Quit", { text: "Ignore all #{dirties.length} unsaved files ?" }
NotePad.singleton = false
this.OS.register "NotePad", NotePad

View File

@ -1,18 +1,18 @@
<afx-app-window apptitle="" width="600" height="400" data-id="notepad">
<afx-vbox>
<afx-hbox data-width = "175" data-id = "sidebar">
<afx-hbox>
<afx-vbox data-width = "175" data-id = "sidebar">
<afx-list-view data-id = "location" dropdown = "true" data-height= "30" width = "150"></afx-list-view>
<afx-file-view data-id = "fileview" view='tree' status = false></afx-file-view>
</afx-hbox>
<afx-hbox>
</afx-vbox>
<afx-vbox>
<afx-tab-container data-id="tabarea" data-height="26" closable = true></afx-tab-container>
<div data-id="datarea"></div>
<afx-vbox data-height="30" data-id="bottom-vbox">
<afx-hbox data-height="30" data-id="bottom-vbox">
<div ><span data-id = "editorstat"></span></div>
<afx-list-view data-width="160" data-id = "themelist" dropdown = "true" width="135"></afx-list-view>
<afx-list-view data-width="125" data-id = "modelist" dropdown = "true" width="100"></afx-list-view>
</afx-vbox>
</afx-hbox>
</afx-vbox>
</afx-hbox>
</afx-vbox>
</afx-hbox>
</afx-app-window>