Last active
November 26, 2015 16:45
-
-
Save yamaaki/e7b3d3060137872b651d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready -> | |
$('.button-collapse').sideNav() | |
rightNav = $('.u-right-nav') | |
if rightNav.length | |
rightNav.pushpin | |
top: rightNav.offset().top | |
$('.scrollspy').scrollSpy() | |
$('select').material_select() | |
$('.datepicker').pickadate | |
monthsFull : [ '1月' , '2月' , '3月' , '4月' , '5月' , '6月' , '7月' , '8月' , '9月' , '10月' , '11月' , '12月' ] , | |
monthsShort : [ '1月' , '2月' , '3月' , '4月' , '5月' , '6月' , '7月' , '8月' , '9月' , '10月' , '11月' , '12月' ] , | |
weekdaysFull : [ '日曜' , '月曜' , '火曜' , '水曜' , '木曜' , '金曜' , '土曜' ], | |
weekdaysShort : [ '日曜' , '月曜' , '火曜' , '水曜' , '木曜' , '金曜' , '土曜' ], | |
weekdaysLetter : [ '日' , '月' , '火' , '水' , '木' , '金' , '土' ] , | |
today: '今日' | |
clear: 'リセット' | |
close: '閉じる' | |
selectMonths: true | |
selectYears: 15 | |
format: 'yyyy.mm.dd' | |
onClose: -> | |
input = $(@['$node'][0]) | |
idVal = input.attr 'id' | |
input.parent().find("label[for=#{idVal}]").removeClass 'active' unless input.val() | |
$(document.activeElement).blur() | |
Waves.displayEffect() | |
$('.u-toast').each -> | |
toast = $(@) | |
Materialize.toast toast.text(), 2000 | |
$('.tooltipped').tooltip | |
delay: 50 | |
$.rails.allowAction = (element) -> | |
message = element.data 'confirm' | |
return yes unless message | |
modal = $('#u-confirm-modal') | |
modal.find('h4').text message | |
modal.find('.u-confirm-modal-ok').on 'click', (e) -> | |
element.data 'confirm', null | |
element.trigger 'click.rails' | |
modal.openModal() | |
return no | |
new WOW().init() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment