aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/forms.coffee32
-rw-r--r--app/assets/javascripts/main_menu.coffee92
2 files changed, 61 insertions, 63 deletions
diff --git a/app/assets/javascripts/forms.coffee b/app/assets/javascripts/forms.coffee
index 33da921b6..d350d4745 100644
--- a/app/assets/javascripts/forms.coffee
+++ b/app/assets/javascripts/forms.coffee
@@ -17,23 +17,21 @@
else
labelCont.text(labelCont.data('checkedvalue'))
-# @submitMover = ->
-# if $('.page-action').children('.formSubmitr').length > 0
-# $('.page-action').children('.formSubmitr').remove()
-#
-# $('.formSubmitr').appendTo('.page-action')
-#
-# # IE fix
-# isIE = false || !!document.documentMode
-# isEdge = !isIE && !!window.StyleMedia
-#
-# if isIE || isEdge
-# $('.formSubmitr').each ->
-# target = $(this).attr('form')
-#
-# $(this).on 'click', ->
-# $('#' + target).submit()
+@submitMover = ->
+ if $('.page-action').children('.formSubmitr').length > 0
+ $('.page-action').children('.formSubmitr').remove()
+
+ $('.formSubmitr').appendTo('.page-action')
+
+ # IE fix
+ isIE = false || !!document.documentMode
+ isEdge = !isIE && !!window.StyleMedia
+
+ if isIE || isEdge
+ $(document).on 'click', '.formSubmitr', ->
+ target = $(this).attr('form')
+ $('#' + target).submit()
$(document).on 'ready page:load', togglableFilter
-# $(document).on 'ready page:load', submitMover
+$(document).on 'ready page:load', submitMover
$(document).on 'ready page:load', switchInput
diff --git a/app/assets/javascripts/main_menu.coffee b/app/assets/javascripts/main_menu.coffee
index 6f882e92c..dee846ffb 100644
--- a/app/assets/javascripts/main_menu.coffee
+++ b/app/assets/javascripts/main_menu.coffee
@@ -1,46 +1,46 @@
-# $(document).on 'ready page:load', ->
-#
-# link = []
-# $(document).on 'page:before-change', ->
-# link = []
-#
-# $el = $('#main_nav')
-# # Opening/closing left-side menu
-# $el.find('.openMenu').on 'click', (e) ->
-# $(this).parent().addClass 'open'
-#
-# $el.find('.closeMenu').on 'click', (e) ->
-# $(this).closest('.nav-menu').removeClass 'open'
-#
-# # Opening menu panel according to current url
-# selectedItem = $el.find('.active')
-# selectedItem.closest('.panel-collapse').addClass 'in'
-# selectedItem.closest('.panel-title').children('a').attr('aria-expanded') == true
-#
-#
-# data = $('.page-action .small')[0].innerHTML
-#
-# stickyContent = '<div class="sticky-content">'
-# stickyContent += '<div class="sticky-ptitle">' + $(".page-title").html() + '</div>'
-# stickyContent += '<div class="sticky-paction"><div class="small">' + data + '</div></div>'
-# stickyContent += '</div>'
-#
-# # Sticky behavior
-# $(document).on 'scroll', ->
-# limit = 51
-#
-# if $(window).scrollTop() >= limit
-# $('#main_nav').addClass 'sticky'
-#
-# if $('#menu_top').find('.sticky-content').length == 0
-# $('#menu_top').children('.menu-content').after(stickyContent)
-# if link.length == 0
-# link = $('.page-action .small').next()
-# $('.sticky-paction .small').after(link)
-#
-# else
-# $('#main_nav').removeClass 'sticky'
-#
-# if $('#menu_top').find('.sticky-content').length > 0
-# $('.page-action .small').after(link)
-# $('.sticky-content').remove()
+$(document).on 'ready page:load', ->
+
+ link = []
+ $(document).on 'page:before-change', ->
+ link = []
+
+ $el = $('#main_nav')
+ # Opening/closing left-side menu
+ $el.find('.openMenu').on 'click', (e) ->
+ $(this).parent().addClass 'open'
+
+ $el.find('.closeMenu').on 'click', (e) ->
+ $(this).closest('.nav-menu').removeClass 'open'
+
+ # Opening menu panel according to current url
+ selectedItem = $el.find('.active')
+ selectedItem.closest('.panel-collapse').addClass 'in'
+ selectedItem.closest('.panel-title').children('a').attr('aria-expanded') == true
+
+
+ data = $('.page-action .small')[0].innerHTML
+
+ stickyContent = '<div class="sticky-content">'
+ stickyContent += '<div class="sticky-ptitle">' + $(".page-title").html() + '</div>'
+ stickyContent += '<div class="sticky-paction"><div class="small">' + data + '</div></div>'
+ stickyContent += '</div>'
+
+ # Sticky behavior
+ $(document).on 'scroll', ->
+ limit = 51
+
+ if $(window).scrollTop() >= limit
+ $('#main_nav').addClass 'sticky'
+
+ if $('#menu_top').find('.sticky-content').length == 0
+ $('#menu_top').children('.menu-content').after(stickyContent)
+ if link.length == 0
+ link = $('.page-action .small').next()
+ $('.sticky-paction .small').after(link)
+
+ else
+ $('#main_nav').removeClass 'sticky'
+
+ if $('#menu_top').find('.sticky-content').length > 0
+ $('.page-action .small').after(link)
+ $('.sticky-content').remove()