|
|
@ -1204,50 +1204,50 @@ window.Modernizr = window.Modernizr || (function(window,doc,undefined){ |
|
|
|
$.widget = $.widget || {}; |
|
|
|
$.widget = $.widget || {}; |
|
|
|
|
|
|
|
|
|
|
|
$.widget.bridge = $.widget.bridge || function( name, object ) { |
|
|
|
$.widget.bridge = $.widget.bridge || function( name, object ) { |
|
|
|
$.fn[ name ] = function( options ) { |
|
|
|
$.fn[ name ] = function( options ) { |
|
|
|
var isMethodCall = typeof options === "string", |
|
|
|
var isMethodCall = typeof options === "string", |
|
|
|
args = Array.prototype.slice.call( arguments, 1 ), |
|
|
|
args = Array.prototype.slice.call( arguments, 1 ), |
|
|
|
returnValue = this; |
|
|
|
returnValue = this; |
|
|
|
|
|
|
|
|
|
|
|
// allow multiple hashes to be passed on init
|
|
|
|
// allow multiple hashes to be passed on init
|
|
|
|
options = !isMethodCall && args.length ? |
|
|
|
options = !isMethodCall && args.length ? |
|
|
|
$.extend.apply( null, [ true, options ].concat(args) ) : |
|
|
|
$.extend.apply( null, [ true, options ].concat(args) ) : |
|
|
|
options; |
|
|
|
options; |
|
|
|
|
|
|
|
|
|
|
|
// prevent calls to internal methods
|
|
|
|
// prevent calls to internal methods
|
|
|
|
if ( isMethodCall && options.charAt( 0 ) === "_" ) { |
|
|
|
if ( isMethodCall && options.charAt( 0 ) === "_" ) { |
|
|
|
return returnValue; |
|
|
|
return returnValue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ( isMethodCall ) { |
|
|
|
if ( isMethodCall ) { |
|
|
|
this.each(function() { |
|
|
|
this.each(function() { |
|
|
|
var instance = $.data( this, name ); |
|
|
|
var instance = $.data( this, name ); |
|
|
|
if ( !instance ) { |
|
|
|
if ( !instance ) { |
|
|
|
return $.error( "cannot call methods on " + name + " prior to initialization; " + |
|
|
|
return $.error( "cannot call methods on " + name + " prior to initialization; " + |
|
|
|
"attempted to call method '" + options + "'" ); |
|
|
|
"attempted to call method '" + options + "'" ); |
|
|
|
} |
|
|
|
} |
|
|
|
if ( !$.isFunction( instance[options] ) ) { |
|
|
|
if ( !$.isFunction( instance[options] ) ) { |
|
|
|
return $.error( "no such method '" + options + "' for " + name + " widget instance" ); |
|
|
|
return $.error( "no such method '" + options + "' for " + name + " widget instance" ); |
|
|
|
} |
|
|
|
} |
|
|
|
var methodValue = instance[ options ].apply( instance, args ); |
|
|
|
var methodValue = instance[ options ].apply( instance, args ); |
|
|
|
if ( methodValue !== instance && methodValue !== undefined ) { |
|
|
|
if ( methodValue !== instance && methodValue !== undefined ) { |
|
|
|
returnValue = methodValue; |
|
|
|
returnValue = methodValue; |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.each(function() { |
|
|
|
this.each(function() { |
|
|
|
var instance = $.data( this, name ); |
|
|
|
var instance = $.data( this, name ); |
|
|
|
if ( instance ) { |
|
|
|
if ( instance ) { |
|
|
|
instance.option( options || {} )._init(); |
|
|
|
instance.option( options || {} )._init(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$.data( this, name, new object( options, this ) ); |
|
|
|
$.data( this, name, new object( options, this ) ); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return returnValue; |
|
|
|
return returnValue; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|