Module: Admin::LayoutsHelper

Defined in:
app/helpers/admin/layouts_helper.rb

Instance Method Summary collapse

Instance Method Details

#layout_edit_javascriptsObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/helpers/admin/layouts_helper.rb', line 2

def layout_edit_javascripts
  (<<-CODE).html_safe
  var tagReferenceWindows = {};
  function loadTagReference() {
    var pageType = 'Page';
    if (!tagReferenceWindows[pageType])
      tagReferenceWindows[pageType] = new Popup.AjaxWindow("#{admin_reference_path('tags')}?class_name=" + encodeURIComponent(pageType), {reload: false});
    var window = tagReferenceWindows[pageType];
    if('Page' != pageType) {
      $('tag_reference_link').highlight();
      window.show();
    } else {
      window.toggle();
    }
    lastPageType = pageType;
    return false;
  }
  CODE
end