2016-01-06 19:11:28 -05:00
|
|
|
RootView = require 'views/core/RootView'
|
|
|
|
template = require 'templates/admin/design-elements-view'
|
|
|
|
|
|
|
|
module.exports = class DesignElementsView extends RootView
|
|
|
|
id: 'design-elements-view'
|
|
|
|
template: template
|
|
|
|
|
|
|
|
afterInsert: ->
|
|
|
|
super()
|
|
|
|
# hack to get hash links to work. Make this general?
|
|
|
|
hash = document.location.hash
|
|
|
|
document.location.hash = ''
|
|
|
|
setTimeout((-> document.location.hash = hash), 10)
|
2016-03-30 16:57:19 -04:00
|
|
|
|
|
|
|
# modal
|
2016-01-06 19:11:28 -05:00
|
|
|
@$('#modal-2').find('.background-wrapper').addClass('plain')
|
2016-03-30 16:57:19 -04:00
|
|
|
|
|
|
|
# tooltips
|
|
|
|
@$('[data-toggle="tooltip"]').tooltip({
|
|
|
|
title: 'Lorem ipsum'
|
|
|
|
trigger: 'click'
|
|
|
|
})
|
2016-01-06 19:33:50 -05:00
|
|
|
if hash is '#tooltips'
|
2016-03-30 16:57:19 -04:00
|
|
|
setTimeout((=> @$('[data-toggle="tooltip"]').tooltip('show')), 20)
|
|
|
|
|
|
|
|
# popovers
|
2016-01-06 19:33:50 -05:00
|
|
|
if hash is '#popovers'
|
|
|
|
setTimeout((=> @$('#popover').popover('show')), 20)
|
2016-03-30 16:57:19 -04:00
|
|
|
|
|
|
|
# autocomplete
|
2016-01-06 19:33:50 -05:00
|
|
|
tags = [
|
2016-03-30 16:57:19 -04:00
|
|
|
"ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang",
|
|
|
|
"Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"
|
2016-01-06 19:33:50 -05:00
|
|
|
]
|
|
|
|
@$('#tags').autocomplete({source: tags})
|
|
|
|
if hash is '#autocomplete'
|
|
|
|
setTimeout((=> @$('#tags').autocomplete("search", "t")), 20)
|
2016-03-30 16:57:19 -04:00
|
|
|
|
|
|
|
# slider
|
2016-01-06 19:33:50 -05:00
|
|
|
@$('#slider-example').slider()
|