bugfix
[redakcja.git] / src / redakcja / static / js / wiki / view_editor_wysiwyg.js
index 3ec4f70..f056edc 100644 (file)
                                 spoint.insertNode(btag[0])
                                 btag.replaceWith(text);
                                 selection.removeAllRanges();
-                                openForEdit($('.motyw[theme-class=' + id + ']'));
+                                openForEdit($('.motyw[theme-class="' + id + '"]'));
                             }
                         });
                     }
             }
             
             tableContent += "</tr>";                                   
-            $("#content").append(specialCharsContainer);
+            $("body").append(specialCharsContainer);
             
             
              // localStorage for recently used characters - reading
 
         if ($origin.is('.motyw')) {
            $('.akap-edit-button').remove();
-            withThemes(function(canonThemes){
-                $('textarea', $overlay).autocomplete(canonThemes, {
-                    autoFill: true,
-                    multiple: true,
-                    selectFirst: true,
-                    highlight: false
-                });
-            })
+            $.themes.autocomplete($('textarea', $overlay));
         }
 
         if ($origin.is('.motyw')){
             $('.delete-button', $overlay).click(function(){
-                if (window.confirm("Czy jesteś pewien, że chcesz usunąć ten motyw ?")) {
-                    $('[theme-class=' + $origin.attr('theme-class') + ']').remove();
+                if (window.confirm("Czy jesteś pewien, że chcesz usunąć ten motyw?")) {
+                    $('[theme-class="' + $origin.attr('theme-class') + '"]').remove();
                     $overlay.remove();
                     $(document).unbind('click.blur-overlay');
                     return false;
                     return false;
                 });            
 
-                $('.edit-button').live('click', function(event){
+                $(document).on('click', '.edit-button', function(event){
                     event.preventDefault();
                     openForEdit($(this).parent());
                 });
 
             }
 
-            $('.motyw').live('click', function(){
+            $(document).on('click', '.motyw', function(){
                 selectTheme($(this).attr('theme-class'));
             });