internetee-registry/app/assets/javascripts/shared/general.coffee
Artur Beljajev 1ed10d2237 Improve date picker UI
- Set first day of week to Monday
- Enable year and month selectors

#590
2017-09-19 13:53:14 +03:00

28 lines
749 B
CoffeeScript

#= require nprogress
#= require nprogress-turbolinks
NProgress.configure
showSpinner: false
@flash_notice = (msg) ->
$('#flash').find('div').removeClass('bg-danger')
$('#flash').find('div').addClass('bg-success')
$('#flash').find('div').html(msg)
$('#flash').show()
@flash_alert = (msg) ->
$('#flash').find('div').removeClass('bg-success')
$('#flash').find('div').addClass('bg-danger')
$('#flash').find('div').html(msg)
$('#flash').show()
$(document).on 'page:change', ->
today = new Date()
tomorrow = new Date(today)
tomorrow.setDate(today.getDate() + 1)
if $('.js-combobox').length
$('.js-combobox').select2
width: "100%"
selectOnBlur: true
dropdownAutoWidth: if self==top then true else false