File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ def message(self, msg):
86
86
try :
87
87
with open (self .page .filename , 'w' ) as f :
88
88
f .write (self .current_code )
89
+ self .pending_messages .append (json .dumps ({
90
+ 'save_success' : True }))
89
91
except IOError :
90
92
print ("Could not save %s; permission denied" %
91
93
self .page .filename )
Original file line number Diff line number Diff line change @@ -171,6 +171,7 @@ Nengo.Ace.prototype.save_file = function () {
171
171
var editor_code = this . editor . getValue ( ) ;
172
172
this . ws . send ( JSON . stringify ( { code :editor_code , save :true } ) ) ;
173
173
this . disable_save ( ) ;
174
+ $ ( '#Save_file' ) . addClass ( 'in-progress' ) ;
174
175
}
175
176
}
176
177
@@ -184,7 +185,11 @@ Nengo.Ace.prototype.disable_save = function () {
184
185
185
186
Nengo . Ace . prototype . on_message = function ( event ) {
186
187
var msg = JSON . parse ( event . data )
187
- if ( msg . code !== undefined ) {
188
+ if ( msg . save_success !== undefined ) {
189
+ if ( msg . save_success ) {
190
+ $ ( '#Save_file' ) . removeClass ( 'in-progress' ) ;
191
+ }
192
+ } else if ( msg . code !== undefined ) {
188
193
this . editor . setValue ( msg . code ) ;
189
194
this . current_code = msg . code ;
190
195
this . editor . gotoLine ( 1 ) ;
Original file line number Diff line number Diff line change 69
69
background : # eee ;
70
70
}
71
71
72
+ # top_toolbar_div li .in-progress a .glyphicon {
73
+ color : # ccc ;
74
+ background : # c22 ;
75
+ }
76
+
72
77
# global_config_menu {
73
78
background : purple;
74
79
height : 20em ;
You can’t perform that action at this time.
0 commit comments