moved spinner interface to jquery, back to more uniform style...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-02-10 05:21:25 +04:00
parent b81712a422
commit 7f3192f99f
2 changed files with 20 additions and 2 deletions

16
ext-lib/jquery.spin.js Executable file
View File

@ -0,0 +1,16 @@
// taken from: http://fgnass.github.com/spin.js/
$.fn.spin = function(opts) {
this.each(function() {
var $this = $(this),
data = $this.data();
if (data.spinner) {
data.spinner.stop();
delete data.spinner;
}
if (opts !== false) {
data.spinner = new Spinner($.extend({color: $this.css('color')}, opts)).spin(this);
}
});
return this;
};

View File

@ -12,6 +12,7 @@
<script src="ext-lib/jquery.touchSwipe.js"></script> <script src="ext-lib/jquery.touchSwipe.js"></script>
<script src="ext-lib/jstorage.js"></script> <script src="ext-lib/jstorage.js"></script>
<script src="ext-lib/spin.js"></script> <script src="ext-lib/spin.js"></script>
<script src="ext-lib/jquery.spin.js"></script>
<!-- EXPERIMENTAL --> <!-- EXPERIMENTAL -->
<!-- <!--
XXX scrollTo is a cool and a powerfull tool but it needs a sustantial code reorganization XXX scrollTo is a cool and a powerfull tool but it needs a sustantial code reorganization
@ -151,8 +152,9 @@ $(document).ready(function(){
setTimeout(function(){ setTimeout(function(){
$('.splash').fadeOut() $('.splash').fadeOut()
}, 350) }, 350)
// remove the spinner...
setTimeout(function(){ setTimeout(function(){
spinner.stop() $('#spinner').spin(false)
}, 500) }, 500)
}) })
@ -195,7 +197,7 @@ $(document).ready(function(){
top: 'auto', // Top position relative to parent in px top: 'auto', // Top position relative to parent in px
left: 'auto' // Left position relative to parent in px left: 'auto' // Left position relative to parent in px
} }
var spinner = new Spinner(opts).spin($('#spinner')[0]) $('#spinner').spin(opts)
</script> </script>
</td></tr></table> </td></tr></table>
</div> </div>