restore save to storable file on table change
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 11 Aug 2012 12:30:57 +0000 (14:30 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 11 Aug 2012 12:30:57 +0000 (14:30 +0200)
public/edit_table.js
public/mojo_facets.css
templates/admin.html.ep

index 3fc390f..d3422eb 100644 (file)
@@ -32,8 +32,7 @@ var cell_blur = function() {
                if ( ! data ) {
                        data = new_content; // fallback to submited data for 304
                } else {
-                       if ( $('a.save_actions').length == 0 )
-                       $('a.actions').before('<a class=save_actions href="/data/save">save</a>')
+                       $('span.save_actions').show();
                }
                var vals = data.split('¶');
                data = vals.join('<span class=d>¶</span>');
index d254856..10ec588 100644 (file)
@@ -258,3 +258,7 @@ span.count span#column_selection {
        position: absolute;
        left: 15em;
 }
+
+.hide {
+       display: none;
+}
index e76d655..0cfb378 100644 (file)
@@ -59,11 +59,13 @@ items:
 <a href="<%= url_for( controller => 'changes', action => 'index', id => 0 ) %>">changes</a>
 <a href="<%= url_for( controller => 'actions', action => 'index', id => 0 ) %>">actions</a>
 
-% if ( session('modified') ) {
-%  my $path = session('path');
+% my $visible_class = session('modified') ? '' : 'hide';
+% my $path = session('path');
+<span class="save_actions <%= $visible_class %>">
 &middot;
-<a class=save_actions title="<%= $path %>" href="<%= url_for( controller => 'data', action => 'save', id => $path ) %>">save</a>
-% }
+<a title="<%= $path %>" href="<%= url_for( controller => 'data', action => 'save' ) %>" >save</a>
+</span>
+
 </span>
 
 </div>