Show More
@@ -24,12 +24,6 b'' | |||
|
24 | 24 | </div> |
|
25 | 25 | |
|
26 | 26 | <div class="table"> |
|
27 | <div id="edit_error" class="flash_msg" style="display:none;"> | |
|
28 | <div class="alert alert-warning"> | |
|
29 | ${h.literal(_('Gist was updated since you started editing. Copy your changes and click %(here)s to reload the new version.') | |
|
30 | % {'here': h.link_to('here',h.url('edit_gist', gist_id=c.gist.gist_access_id))})} | |
|
31 | </div> | |
|
32 | </div> | |
|
33 | 27 | |
|
34 | 28 | <div id="files_data"> |
|
35 | 29 | ${h.secure_form(h.url('edit_gist', gist_id=c.gist.gist_access_id), method='post', id='eform')} |
@@ -115,7 +109,6 b'' | |||
|
115 | 109 | <script> |
|
116 | 110 | $('#update').on('click', function(e){ |
|
117 | 111 | e.preventDefault(); |
|
118 | ||
|
119 | 112 | // check for newer version. |
|
120 | 113 | $.ajax({ |
|
121 | 114 | url: "${h.url('edit_gist_check_revision', gist_id=c.gist.gist_access_id)}", |
@@ -126,8 +119,11 b'' | |||
|
126 | 119 | type: 'GET', |
|
127 | 120 | success: function(data) { |
|
128 | 121 | if(data.success === false){ |
|
129 | $('#edit_error').show(); | |
|
130 | window.scrollTo(0,0); | |
|
122 | message = '${h.literal(_('Gist was updated since you started editing. Copy your changes and click %(here)s to reload the new version.') | |
|
123 | % {'here': h.link_to('here',h.url('edit_gist', gist_id=c.gist.gist_access_id))})}' | |
|
124 | alertMessage = [{"message": { | |
|
125 | "message": message, "force": "true", "level": "warning"}}]; | |
|
126 | $.Topic('/notifications').publish(alertMessage[0]); | |
|
131 | 127 | } |
|
132 | 128 | else{ |
|
133 | 129 | $('#eform').submit(); |
General Comments 0
You need to be logged in to leave comments.
Login now