]> dev.renevier.net Git - syj.git/blobdiff - public/js/deck.js
assemble all utils scripts in a utils.js file
[syj.git] / public / js / deck.js
diff --git a/public/js/deck.js b/public/js/deck.js
deleted file mode 100644 (file)
index 73bc3d2..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
-    and is published under the AGPL license. */
-var Deck = Class.create();
-Deck.prototype = {
-    initialize: function(elt, options) {
-        this.element = $(elt);
-        this.index = null;
-        this.setIndex(parseInt(this.element.readAttribute("selectedindex") || 0, 10));
-    },
-    setIndex: function(idx) {
-        if (idx === this.index) {
-            return;
-        }
-
-        var childs = this.element.childElements();
-        if (childs.length === 0) {
-            this.index = -1;
-            return;
-        }
-        idx = Math.max(0, idx);
-        idx = Math.min(childs.length - 1, idx);
-
-        childs.each(function(item, i) {
-            if (idx === i) {
-                item.show();
-            } else {
-                item.hide();
-            }
-        });
-        this.index = idx;
-    },
-    getIndex: function() {
-        return this.index;
-    }
-};