Bug fix since recent commits to master where Textile was not being rendered any more...
authorPhil Hodgson <bitbucket@philhodgson.net>
Mon, 11 Aug 2014 16:20:51 +0000 (12:20 -0400)
committerPhil Hodgson <bitbucket@philhodgson.net>
Mon, 11 Aug 2014 16:20:51 +0000 (12:20 -0400)
Something must have changed in the general JS event handling! Anyway, I now store the textile in a data attribute and then place it in the element later, during the on('hidden') phase

apps/workbench/app/assets/javascripts/editable.js

index 25d38a9cf6593664e524fb1410a6bdcb08d814bd..dc54bda7af79a17f7a7eae3ec1aa9d059ac9851d 100644 (file)
@@ -58,7 +58,7 @@ $(document).
                     if ($(this).attr('data-name')) {
                         var textileAttr = $(this).attr('data-name') + 'Textile';
                         if (response[textileAttr]) {
-                            $(this).html(response[textileAttr]);
+                            $(this).attr('data-textile', response[textileAttr]);
                         }
                     }
                     return;
@@ -81,6 +81,10 @@ $(document).
                 // information if it appears elsewhere on the page.
                 if (reason != 'save') return;
                 var html = $(this).html();
+                if( $(this).attr('data-textile') ) {
+                    html = $(this).attr('data-textile');
+                    $(this).html(html);
+                }
                 var uuid = $(this).attr('data-object-uuid');
                 var attr = $(this).attr('data-name');
                 var edited = this;