Permalink
Browse files

Update slidebox/slidebox.js

added getter for 'getSelectedIndex'
  • Loading branch information...
1 parent fe83a08 commit 770ed9790d945ba1d4479fa19a622816546c6272 @tiggerunix committed Jan 5, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 slidebox/slidebox.js
View
9 slidebox/slidebox.js
@@ -52,6 +52,15 @@
getters:{
'orientation': function(){
return this.getAttribute('orientation');
+ },
+ 'getSelectedIndex': function(){
+ var slides = this.querySelectorAll('x-slide');
+ for (var i = 0;i<slides.length;i++){
+ if (slides[i].hasAttribute("selected")){
+ return i;
+ }
+ }
+ return -1;
}
},
methods: {

0 comments on commit 770ed97

Please sign in to comment.