aboutsummaryrefslogtreecommitdiffstats
path: root/g/fa/docs/assets/js/index/index.js
blob: 0858f0cf63db63a9d28f71a204deba1111292b3d (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
$(function() {
    var MainView = Backbone.View.extend({
        el: $("div.container"),

        modalTemplate: _.template($("#modal-template").html()),

        events:{
            "click ul.the-icons > li": "iconClicked"
        },

        iconClicked: function(event) {
            event.preventDefault();

            var $item = $(event.currentTarget);
            var $modal = $(this.modalTemplate({"style": $item.attr("class")}));

            $modal.modal("show");
            $modal.on('hidden', function () {
                $modal.remove();
            })
        }
    });

    var mainView = new MainView();
});