small circular points
[MojoFacets.git] / public / edit_table.js
index 3fc390f..f57f833 100644 (file)
@@ -13,8 +13,13 @@ var cell_blur = function() {
 */
        var _row_id = $(this).parent().parent().attr('title');
 
-       var x = $(this).parent().attr('cellIndex');
-       var y = $(this).parent().parent().attr('rowIndex');
+       var x = $(this).parent().index();
+       var y = $(this).parent().parent().index();
+
+       if ( x == null || y == null ) {
+               console.error('no x ', x, ' or y ', y, ' defined');
+               return;
+       }
 
        var new_content = $(this).val();
 //     $(this).replaceWith( new_content );
@@ -32,8 +37,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>');