summaryrefslogtreecommitdiffstats
path: root/coffee/directives/addfolderselect.coffee
blob: 1aa77c556443d3009323d0d4a711fdc9dae93def (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
###
# ownCloud news app
#
# @author Alessandro Cosentino
# @author Bernhard Posselt
# Copyright (c) 2012 - Alessandro Cosentino <cosenal@gmail.com>
# Copyright (c) 2012 - Bernhard Posselt <nukeawhale@gmail.com>
#
# This file is licensed under the Affero General Public License version 3 or
# later.
#
# See the COPYING-README file
#
###

###
Turns a normal select into a folder select with the ability to create new folders
###
angular.module('News').directive 'addFolderSelect', ['$rootScope', ->

        return (scope, elm, attr) ->

                options =
                        singleSelect: true
                        selectedFirst: true
                        createText: $(elm).data('create')
                        createdCallback: (selected, value) ->
                                console.log selected
                                console.log value

                $(elm).multiSelect(options)

]