Permalink
Browse files

Updated definitions, and added tests

  • Loading branch information...
1 parent 3d3266a commit 08438c1722a843f7d9c7ed59e2a7a4c5081e2958 @csrakowski csrakowski committed Mar 31, 2013
Showing with 41 additions and 23 deletions.
  1. +28 −0 jquery.tinyscrollbar/jquery.tinyscrollbar-tests.ts
  2. +13 −23 jquery.tinyscrollbar/jquery.tinyscrollbar.d.ts
@@ -0,0 +1,28 @@
+/// <reference path="jquery.tinyscrollbar.d.ts" />
+
+$('#scrollbar1').tinyscrollbar();
+$('#scrollbar2').tinyscrollbar({ axis: 'x' });
+$('#scrollbar3').tinyscrollbar({ size: 100 });
+$('#scrollbar4').tinyscrollbar({ sizethumb: 15 });
+
+var oScrollbar5 = $('#scrollbar5');
+oScrollbar5.tinyscrollbar();
+
+//some operation that changes the viewport content...
+
+oScrollbar5.tinyscrollbar_update();
+
+var oScroll6 = $('#scrollbar6');
+oScroll6.tinyscrollbar();
+
+//add a click event to a button
+$('#scrollbar6-anchor').click(function () {
+ oScroll6.tinyscrollbar_update(50);
+ return false;
+});
+
+var oScrollbar = $('#scrollbar1');
+oScrollbar.tinyscrollbar();
+
+oScrollbar.tinyscrollbar_update();
+oScrollbar.tinyscrollbar_update('bottom');
@@ -5,28 +5,18 @@
/// <reference path="../jquery/jquery.d.ts" />
-interface JQueryTinyScrollbar extends JQuery {
- tinyscrollbar(): JQuery;
- tinyscrollbar_update(): JQuery;
+module JQueryTinyScrollbar {
+ export interface JQueryTinyScrollbarOptions {
+ invertscroll?: bool;
+ axis?: string;
+ wheel?: number;
+ scroll?: bool;
+ lockscroll?: bool;
+ size?: any; //string or number
+ sizethumb?: any; //string or number
+ }
}
-
-
-interface JQueryTinyScrollbarOptions {
- invertscroll?: bool;
- axis?: string;
- wheel?: number;
- scroll?: bool;
- lockscroll?: bool;
- size?: any; //string or number
- sizethumb?: any; //string or number
-}
-
-interface JQueryTinyScrollbarStatic {
-
- tinyscrollbar(options: JQueryTinyScrollbarOptions): JQueryTinyScrollbar;
- tinyscrollbar_update(options:any): JQueryTinyScrollbar;
-}
-
-interface JQuery extends JQueryTinyScrollbarStatic {
-
+interface JQuery {
+ tinyscrollbar(options?: JQueryTinyScrollbar.JQueryTinyScrollbarOptions): JQuery;
+ tinyscrollbar_update(options?: any): JQuery;
}

0 comments on commit 08438c1

Please sign in to comment.