r2573 - spinner: fixed mousewheel option when set on init. added mousewheel disabled demo.
Author: pazu2k@gmail.com
Date: Thu May 14 22:25:52 2009
New Revision: 2573
Added:
branches/dev/spinner/demos/spinner/mousewheel-disabled.html
Modified:
branches/dev/spinner/demos/index.html
branches/dev/spinner/demos/spinner/index.html
branches/dev/spinner/ui/ui.spinner.js
Log:
spinner: fixed mousewheel option when set on init. added mousewheel
disabled demo.
Modified: branches/dev/spinner/demos/index.html
==============================================================================
--- branches/dev/spinner/demos/index.html (original)
+++ branches/dev/spinner/demos/index.html Thu May 14 22:25:52 2009
@@ -7,6 +7,7 @@
<link type="text/css" href="demos.css" rel="stylesheet" />
<script type="text/javascript" src="../jquery-1.3.2.js"></script>
<script type="text/javascript"
src="../external/bgiframe/jquery.bgiframe.js"></script>
+ <script type="text/javascript"
src="../external/mousewheel/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.accordion.js"></script>
<script type="text/javascript" src="../ui/ui.datepicker.js"></script>
Modified: branches/dev/spinner/demos/spinner/index.html
==============================================================================
--- branches/dev/spinner/demos/spinner/index.html (original)
+++ branches/dev/spinner/demos/spinner/index.html Thu May 14 22:25:52 2009
@@ -13,6 +13,7 @@
<li><a href="latlong.html">Map</a></li>
<li><a href="list.html">List</a></li>
<li><a href="incremental.html">Incremental</a></li>
+ <li><a href="mousewheel-disabled.html">Mousewheel Disabled</a></li>
</ul>
</div>
</body>
Added: branches/dev/spinner/demos/spinner/mousewheel-disabled.html
==============================================================================
--- (empty file)
+++ branches/dev/spinner/demos/spinner/mousewheel-disabled.html Thu May 14
22:25:52 2009
@@ -0,0 +1,49 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI Spinner - Default functionality</title>
+ <link type="text/css" href="../../themes/base/ui.all.css"
rel="stylesheet" />
+ <script type="text/javascript" src="../../jquery-1.3.2.js"></script>
+ <script type="text/javascript"
src="../../external/mousewheel/jquery.mousewheel.min.js"></script>
+ <script type="text/javascript" src="../../ui/ui.core.js"></script>
+ <script type="text/javascript" src="../../ui/ui.spinner.js"></script>
+ <link type="text/css" href="../demos.css" rel="stylesheet" />
+ <script type="text/javascript">
+ $(function() {
+ $("#s1").spinner({mouseWheel: false});
+
+ $("#enable").toggle(function() {
+ $("#s1").spinner("option", "mouseWheel", true);
+ }, function() {
+ $("#s1").spinner("option", "mouseWheel", false);
+ })
+
+ $(".ui-button").hover(function() {
+ $(this).addClass("ui-state-hover");
+ }, function() {
+ $(this).removeClass("ui-state-hover");
+ });
+ });
+ </script>
+</head>
+<body>
+
+<div class="demo">
+
+<label for="s1">Select a value:</label>
+<input id="s1" name="value" />
+
+
+<button id="enable" class="ui-button ui-state-default
ui-corner-all">Toggle enable/disable Mousewheel</button>
+
+
+</div><!-- End demo -->
+
+<div class="demo-description">
+
+Default spinner with Mousewheel disabled. This demonstrates the ability to
target individual spinners to disable the mousewheel interaction if
necessary.
+
+</div><!-- End demo-description -->
+
+</body>
+</html>
Modified: branches/dev/spinner/ui/ui.spinner.js
==============================================================================
--- branches/dev/spinner/ui/ui.spinner.js (original)
+++ branches/dev/spinner/ui/ui.spinner.js Thu May 14 22:25:52 2009
@@ -195,7 +195,7 @@
self._cleanUp();
});
- if ($.fn.mousewheel) {
+ if ($.fn.mousewheel && this.options.mouseWheel) {
this.element.mousewheel(self._mousewheel);
}
},