X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=public%2Fjs%2Fdeck.js;fp=public%2Fjs%2Fdeck.js;h=0000000000000000000000000000000000000000;hb=1de0f433144272946051bb0df886b8c43459beb8;hp=73bc3d21cac76bce24555dd2a73ede3bd5ad4c1e;hpb=d9f13fbba43193040911105caf393aff945eb02d;p=syj.git diff --git a/public/js/deck.js b/public/js/deck.js deleted file mode 100644 index 73bc3d2..0000000 --- a/public/js/deck.js +++ /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; - } -};