├── custom-directives-2 ├── autocomplete-jquery-ui.js └── autocomplete-jquery-ui.structure.css └── resource ├── css ├── lumx.css ├── main.css └── materialdesignicons.css ├── fonts ├── materialdesignicons-webfont.eot ├── materialdesignicons-webfont.svg ├── materialdesignicons-webfont.ttf ├── materialdesignicons-webfont.woff └── materialdesignicons-webfont.woff2 ├── imgs └── user.jpg ├── index.html └── js ├── app.js ├── controllers.js ├── directives.js ├── lumx.js └── services.js /custom-directives-2/autocomplete-jquery-ui.js: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.11.2 - 2015-01-18 2 | * http://jqueryui.com 3 | * Includes: core.js, widget.js, position.js, autocomplete.js, menu.js 4 | * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ 5 | 6 | (function( factory ) { 7 | if ( typeof define === "function" && define.amd ) { 8 | 9 | // AMD. Register as an anonymous module. 10 | define([ "jquery" ], factory ); 11 | } else { 12 | 13 | // Browser globals 14 | factory( jQuery ); 15 | } 16 | }(function( $ ) { 17 | /*! 18 | * jQuery UI Core 1.11.2 19 | * http://jqueryui.com 20 | * 21 | * Copyright 2014 jQuery Foundation and other contributors 22 | * Released under the MIT license. 23 | * http://jquery.org/license 24 | * 25 | * http://api.jqueryui.com/category/ui-core/ 26 | */ 27 | 28 | 29 | // $.ui might exist from components with no dependencies, e.g., $.ui.position 30 | $.ui = $.ui || {}; 31 | 32 | $.extend( $.ui, { 33 | version: "1.11.2", 34 | 35 | keyCode: { 36 | BACKSPACE: 8, 37 | COMMA: 188, 38 | DELETE: 46, 39 | DOWN: 40, 40 | END: 35, 41 | ENTER: 13, 42 | ESCAPE: 27, 43 | HOME: 36, 44 | LEFT: 37, 45 | PAGE_DOWN: 34, 46 | PAGE_UP: 33, 47 | PERIOD: 190, 48 | RIGHT: 39, 49 | SPACE: 32, 50 | TAB: 9, 51 | UP: 38 52 | } 53 | }); 54 | 55 | // plugins 56 | $.fn.extend({ 57 | scrollParent: function( includeHidden ) { 58 | var position = this.css( "position" ), 59 | excludeStaticParent = position === "absolute", 60 | overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, 61 | scrollParent = this.parents().filter( function() { 62 | var parent = $( this ); 63 | if ( excludeStaticParent && parent.css( "position" ) === "static" ) { 64 | return false; 65 | } 66 | return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) ); 67 | }).eq( 0 ); 68 | 69 | return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent; 70 | }, 71 | 72 | uniqueId: (function() { 73 | var uuid = 0; 74 | 75 | return function() { 76 | return this.each(function() { 77 | if ( !this.id ) { 78 | this.id = "ui-id-" + ( ++uuid ); 79 | } 80 | }); 81 | }; 82 | })(), 83 | 84 | removeUniqueId: function() { 85 | return this.each(function() { 86 | if ( /^ui-id-\d+$/.test( this.id ) ) { 87 | $( this ).removeAttr( "id" ); 88 | } 89 | }); 90 | } 91 | }); 92 | 93 | // selectors 94 | function focusable( element, isTabIndexNotNaN ) { 95 | var map, mapName, img, 96 | nodeName = element.nodeName.toLowerCase(); 97 | if ( "area" === nodeName ) { 98 | map = element.parentNode; 99 | mapName = map.name; 100 | if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { 101 | return false; 102 | } 103 | img = $( "img[usemap='#" + mapName + "']" )[ 0 ]; 104 | return !!img && visible( img ); 105 | } 106 | return ( /input|select|textarea|button|object/.test( nodeName ) ? 107 | !element.disabled : 108 | "a" === nodeName ? 109 | element.href || isTabIndexNotNaN : 110 | isTabIndexNotNaN) && 111 | // the element and all of its ancestors must be visible 112 | visible( element ); 113 | } 114 | 115 | function visible( element ) { 116 | return $.expr.filters.visible( element ) && 117 | !$( element ).parents().addBack().filter(function() { 118 | return $.css( this, "visibility" ) === "hidden"; 119 | }).length; 120 | } 121 | 122 | $.extend( $.expr[ ":" ], { 123 | data: $.expr.createPseudo ? 124 | $.expr.createPseudo(function( dataName ) { 125 | return function( elem ) { 126 | return !!$.data( elem, dataName ); 127 | }; 128 | }) : 129 | // support: jQuery <1.8 130 | function( elem, i, match ) { 131 | return !!$.data( elem, match[ 3 ] ); 132 | }, 133 | 134 | focusable: function( element ) { 135 | return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); 136 | }, 137 | 138 | tabbable: function( element ) { 139 | var tabIndex = $.attr( element, "tabindex" ), 140 | isTabIndexNaN = isNaN( tabIndex ); 141 | return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); 142 | } 143 | }); 144 | 145 | // support: jQuery <1.8 146 | if ( !$( "" ).outerWidth( 1 ).jquery ) { 147 | $.each( [ "Width", "Height" ], function( i, name ) { 148 | var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], 149 | type = name.toLowerCase(), 150 | orig = { 151 | innerWidth: $.fn.innerWidth, 152 | innerHeight: $.fn.innerHeight, 153 | outerWidth: $.fn.outerWidth, 154 | outerHeight: $.fn.outerHeight 155 | }; 156 | 157 | function reduce( elem, size, border, margin ) { 158 | $.each( side, function() { 159 | size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; 160 | if ( border ) { 161 | size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; 162 | } 163 | if ( margin ) { 164 | size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; 165 | } 166 | }); 167 | return size; 168 | } 169 | 170 | $.fn[ "inner" + name ] = function( size ) { 171 | if ( size === undefined ) { 172 | return orig[ "inner" + name ].call( this ); 173 | } 174 | 175 | return this.each(function() { 176 | $( this ).css( type, reduce( this, size ) + "px" ); 177 | }); 178 | }; 179 | 180 | $.fn[ "outer" + name] = function( size, margin ) { 181 | if ( typeof size !== "number" ) { 182 | return orig[ "outer" + name ].call( this, size ); 183 | } 184 | 185 | return this.each(function() { 186 | $( this).css( type, reduce( this, size, true, margin ) + "px" ); 187 | }); 188 | }; 189 | }); 190 | } 191 | 192 | // support: jQuery <1.8 193 | if ( !$.fn.addBack ) { 194 | $.fn.addBack = function( selector ) { 195 | return this.add( selector == null ? 196 | this.prevObject : this.prevObject.filter( selector ) 197 | ); 198 | }; 199 | } 200 | 201 | // support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413) 202 | if ( $( "" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) { 203 | $.fn.removeData = (function( removeData ) { 204 | return function( key ) { 205 | if ( arguments.length ) { 206 | return removeData.call( this, $.camelCase( key ) ); 207 | } else { 208 | return removeData.call( this ); 209 | } 210 | }; 211 | })( $.fn.removeData ); 212 | } 213 | 214 | // deprecated 215 | $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); 216 | 217 | $.fn.extend({ 218 | focus: (function( orig ) { 219 | return function( delay, fn ) { 220 | return typeof delay === "number" ? 221 | this.each(function() { 222 | var elem = this; 223 | setTimeout(function() { 224 | $( elem ).focus(); 225 | if ( fn ) { 226 | fn.call( elem ); 227 | } 228 | }, delay ); 229 | }) : 230 | orig.apply( this, arguments ); 231 | }; 232 | })( $.fn.focus ), 233 | 234 | disableSelection: (function() { 235 | var eventType = "onselectstart" in document.createElement( "div" ) ? 236 | "selectstart" : 237 | "mousedown"; 238 | 239 | return function() { 240 | return this.bind( eventType + ".ui-disableSelection", function( event ) { 241 | event.preventDefault(); 242 | }); 243 | }; 244 | })(), 245 | 246 | enableSelection: function() { 247 | return this.unbind( ".ui-disableSelection" ); 248 | }, 249 | 250 | zIndex: function( zIndex ) { 251 | if ( zIndex !== undefined ) { 252 | return this.css( "zIndex", zIndex ); 253 | } 254 | 255 | if ( this.length ) { 256 | var elem = $( this[ 0 ] ), position, value; 257 | while ( elem.length && elem[ 0 ] !== document ) { 258 | // Ignore z-index if position is set to a value where z-index is ignored by the browser 259 | // This makes behavior of this function consistent across browsers 260 | // WebKit always returns auto if the element is positioned 261 | position = elem.css( "position" ); 262 | if ( position === "absolute" || position === "relative" || position === "fixed" ) { 263 | // IE returns 0 when zIndex is not specified 264 | // other browsers return a string 265 | // we ignore the case of nested elements with an explicit value of 0 266 | //
267 | value = parseInt( elem.css( "zIndex" ), 10 ); 268 | if ( !isNaN( value ) && value !== 0 ) { 269 | return value; 270 | } 271 | } 272 | elem = elem.parent(); 273 | } 274 | } 275 | 276 | return 0; 277 | } 278 | }); 279 | 280 | // $.ui.plugin is deprecated. Use $.widget() extensions instead. 281 | $.ui.plugin = { 282 | add: function( module, option, set ) { 283 | var i, 284 | proto = $.ui[ module ].prototype; 285 | for ( i in set ) { 286 | proto.plugins[ i ] = proto.plugins[ i ] || []; 287 | proto.plugins[ i ].push( [ option, set[ i ] ] ); 288 | } 289 | }, 290 | call: function( instance, name, args, allowDisconnected ) { 291 | var i, 292 | set = instance.plugins[ name ]; 293 | 294 | if ( !set ) { 295 | return; 296 | } 297 | 298 | if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) { 299 | return; 300 | } 301 | 302 | for ( i = 0; i < set.length; i++ ) { 303 | if ( instance.options[ set[ i ][ 0 ] ] ) { 304 | set[ i ][ 1 ].apply( instance.element, args ); 305 | } 306 | } 307 | } 308 | }; 309 | 310 | 311 | /*! 312 | * jQuery UI Widget 1.11.2 313 | * http://jqueryui.com 314 | * 315 | * Copyright 2014 jQuery Foundation and other contributors 316 | * Released under the MIT license. 317 | * http://jquery.org/license 318 | * 319 | * http://api.jqueryui.com/jQuery.widget/ 320 | */ 321 | 322 | 323 | var widget_uuid = 0, 324 | widget_slice = Array.prototype.slice; 325 | 326 | $.cleanData = (function( orig ) { 327 | return function( elems ) { 328 | var events, elem, i; 329 | for ( i = 0; (elem = elems[i]) != null; i++ ) { 330 | try { 331 | 332 | // Only trigger remove when necessary to save time 333 | events = $._data( elem, "events" ); 334 | if ( events && events.remove ) { 335 | $( elem ).triggerHandler( "remove" ); 336 | } 337 | 338 | // http://bugs.jquery.com/ticket/8235 339 | } catch ( e ) {} 340 | } 341 | orig( elems ); 342 | }; 343 | })( $.cleanData ); 344 | 345 | $.widget = function( name, base, prototype ) { 346 | var fullName, existingConstructor, constructor, basePrototype, 347 | // proxiedPrototype allows the provided prototype to remain unmodified 348 | // so that it can be used as a mixin for multiple widgets (#8876) 349 | proxiedPrototype = {}, 350 | namespace = name.split( "." )[ 0 ]; 351 | 352 | name = name.split( "." )[ 1 ]; 353 | fullName = namespace + "-" + name; 354 | 355 | if ( !prototype ) { 356 | prototype = base; 357 | base = $.Widget; 358 | } 359 | 360 | // create selector for plugin 361 | $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { 362 | return !!$.data( elem, fullName ); 363 | }; 364 | 365 | $[ namespace ] = $[ namespace ] || {}; 366 | existingConstructor = $[ namespace ][ name ]; 367 | constructor = $[ namespace ][ name ] = function( options, element ) { 368 | // allow instantiation without "new" keyword 369 | if ( !this._createWidget ) { 370 | return new constructor( options, element ); 371 | } 372 | 373 | // allow instantiation without initializing for simple inheritance 374 | // must use "new" keyword (the code above always passes args) 375 | if ( arguments.length ) { 376 | this._createWidget( options, element ); 377 | } 378 | }; 379 | // extend with the existing constructor to carry over any static properties 380 | $.extend( constructor, existingConstructor, { 381 | version: prototype.version, 382 | // copy the object used to create the prototype in case we need to 383 | // redefine the widget later 384 | _proto: $.extend( {}, prototype ), 385 | // track widgets that inherit from this widget in case this widget is 386 | // redefined after a widget inherits from it 387 | _childConstructors: [] 388 | }); 389 | 390 | basePrototype = new base(); 391 | // we need to make the options hash a property directly on the new instance 392 | // otherwise we'll modify the options hash on the prototype that we're 393 | // inheriting from 394 | basePrototype.options = $.widget.extend( {}, basePrototype.options ); 395 | $.each( prototype, function( prop, value ) { 396 | if ( !$.isFunction( value ) ) { 397 | proxiedPrototype[ prop ] = value; 398 | return; 399 | } 400 | proxiedPrototype[ prop ] = (function() { 401 | var _super = function() { 402 | return base.prototype[ prop ].apply( this, arguments ); 403 | }, 404 | _superApply = function( args ) { 405 | return base.prototype[ prop ].apply( this, args ); 406 | }; 407 | return function() { 408 | var __super = this._super, 409 | __superApply = this._superApply, 410 | returnValue; 411 | 412 | this._super = _super; 413 | this._superApply = _superApply; 414 | 415 | returnValue = value.apply( this, arguments ); 416 | 417 | this._super = __super; 418 | this._superApply = __superApply; 419 | 420 | return returnValue; 421 | }; 422 | })(); 423 | }); 424 | constructor.prototype = $.widget.extend( basePrototype, { 425 | // TODO: remove support for widgetEventPrefix 426 | // always use the name + a colon as the prefix, e.g., draggable:start 427 | // don't prefix for widgets that aren't DOM-based 428 | widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name 429 | }, proxiedPrototype, { 430 | constructor: constructor, 431 | namespace: namespace, 432 | widgetName: name, 433 | widgetFullName: fullName 434 | }); 435 | 436 | // If this widget is being redefined then we need to find all widgets that 437 | // are inheriting from it and redefine all of them so that they inherit from 438 | // the new version of this widget. We're essentially trying to replace one 439 | // level in the prototype chain. 440 | if ( existingConstructor ) { 441 | $.each( existingConstructor._childConstructors, function( i, child ) { 442 | var childPrototype = child.prototype; 443 | 444 | // redefine the child widget using the same prototype that was 445 | // originally used, but inherit from the new version of the base 446 | $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); 447 | }); 448 | // remove the list of existing child constructors from the old constructor 449 | // so the old child constructors can be garbage collected 450 | delete existingConstructor._childConstructors; 451 | } else { 452 | base._childConstructors.push( constructor ); 453 | } 454 | 455 | $.widget.bridge( name, constructor ); 456 | 457 | return constructor; 458 | }; 459 | 460 | $.widget.extend = function( target ) { 461 | var input = widget_slice.call( arguments, 1 ), 462 | inputIndex = 0, 463 | inputLength = input.length, 464 | key, 465 | value; 466 | for ( ; inputIndex < inputLength; inputIndex++ ) { 467 | for ( key in input[ inputIndex ] ) { 468 | value = input[ inputIndex ][ key ]; 469 | if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { 470 | // Clone objects 471 | if ( $.isPlainObject( value ) ) { 472 | target[ key ] = $.isPlainObject( target[ key ] ) ? 473 | $.widget.extend( {}, target[ key ], value ) : 474 | // Don't extend strings, arrays, etc. with objects 475 | $.widget.extend( {}, value ); 476 | // Copy everything else by reference 477 | } else { 478 | target[ key ] = value; 479 | } 480 | } 481 | } 482 | } 483 | return target; 484 | }; 485 | 486 | $.widget.bridge = function( name, object ) { 487 | var fullName = object.prototype.widgetFullName || name; 488 | $.fn[ name ] = function( options ) { 489 | var isMethodCall = typeof options === "string", 490 | args = widget_slice.call( arguments, 1 ), 491 | returnValue = this; 492 | 493 | // allow multiple hashes to be passed on init 494 | options = !isMethodCall && args.length ? 495 | $.widget.extend.apply( null, [ options ].concat(args) ) : 496 | options; 497 | 498 | if ( isMethodCall ) { 499 | this.each(function() { 500 | var methodValue, 501 | instance = $.data( this, fullName ); 502 | if ( options === "instance" ) { 503 | returnValue = instance; 504 | return false; 505 | } 506 | if ( !instance ) { 507 | return $.error( "cannot call methods on " + name + " prior to initialization; " + 508 | "attempted to call method '" + options + "'" ); 509 | } 510 | if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) { 511 | return $.error( "no such method '" + options + "' for " + name + " widget instance" ); 512 | } 513 | methodValue = instance[ options ].apply( instance, args ); 514 | if ( methodValue !== instance && methodValue !== undefined ) { 515 | returnValue = methodValue && methodValue.jquery ? 516 | returnValue.pushStack( methodValue.get() ) : 517 | methodValue; 518 | return false; 519 | } 520 | }); 521 | } else { 522 | this.each(function() { 523 | var instance = $.data( this, fullName ); 524 | if ( instance ) { 525 | instance.option( options || {} ); 526 | if ( instance._init ) { 527 | instance._init(); 528 | } 529 | } else { 530 | $.data( this, fullName, new object( options, this ) ); 531 | } 532 | }); 533 | } 534 | 535 | return returnValue; 536 | }; 537 | }; 538 | 539 | $.Widget = function( /* options, element */ ) {}; 540 | $.Widget._childConstructors = []; 541 | 542 | $.Widget.prototype = { 543 | widgetName: "widget", 544 | widgetEventPrefix: "", 545 | defaultElement: "
", 546 | options: { 547 | disabled: false, 548 | 549 | // callbacks 550 | create: null 551 | }, 552 | _createWidget: function( options, element ) { 553 | element = $( element || this.defaultElement || this )[ 0 ]; 554 | this.element = $( element ); 555 | this.uuid = widget_uuid++; 556 | this.eventNamespace = "." + this.widgetName + this.uuid; 557 | 558 | this.bindings = $(); 559 | this.hoverable = $(); 560 | this.focusable = $(); 561 | 562 | if ( element !== this ) { 563 | $.data( element, this.widgetFullName, this ); 564 | this._on( true, this.element, { 565 | remove: function( event ) { 566 | if ( event.target === element ) { 567 | this.destroy(); 568 | } 569 | } 570 | }); 571 | this.document = $( element.style ? 572 | // element within the document 573 | element.ownerDocument : 574 | // element is window or document 575 | element.document || element ); 576 | this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); 577 | } 578 | 579 | this.options = $.widget.extend( {}, 580 | this.options, 581 | this._getCreateOptions(), 582 | options ); 583 | 584 | this._create(); 585 | this._trigger( "create", null, this._getCreateEventData() ); 586 | this._init(); 587 | }, 588 | _getCreateOptions: $.noop, 589 | _getCreateEventData: $.noop, 590 | _create: $.noop, 591 | _init: $.noop, 592 | 593 | destroy: function() { 594 | this._destroy(); 595 | // we can probably remove the unbind calls in 2.0 596 | // all event bindings should go through this._on() 597 | this.element 598 | .unbind( this.eventNamespace ) 599 | .removeData( this.widgetFullName ) 600 | // support: jquery <1.6.3 601 | // http://bugs.jquery.com/ticket/9413 602 | .removeData( $.camelCase( this.widgetFullName ) ); 603 | this.widget() 604 | .unbind( this.eventNamespace ) 605 | .removeAttr( "aria-disabled" ) 606 | .removeClass( 607 | this.widgetFullName + "-disabled " + 608 | "ui-state-disabled" ); 609 | 610 | // clean up events and states 611 | this.bindings.unbind( this.eventNamespace ); 612 | this.hoverable.removeClass( "ui-state-hover" ); 613 | this.focusable.removeClass( "ui-state-focus" ); 614 | }, 615 | _destroy: $.noop, 616 | 617 | widget: function() { 618 | return this.element; 619 | }, 620 | 621 | option: function( key, value ) { 622 | var options = key, 623 | parts, 624 | curOption, 625 | i; 626 | 627 | if ( arguments.length === 0 ) { 628 | // don't return a reference to the internal hash 629 | return $.widget.extend( {}, this.options ); 630 | } 631 | 632 | if ( typeof key === "string" ) { 633 | // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } 634 | options = {}; 635 | parts = key.split( "." ); 636 | key = parts.shift(); 637 | if ( parts.length ) { 638 | curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); 639 | for ( i = 0; i < parts.length - 1; i++ ) { 640 | curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; 641 | curOption = curOption[ parts[ i ] ]; 642 | } 643 | key = parts.pop(); 644 | if ( arguments.length === 1 ) { 645 | return curOption[ key ] === undefined ? null : curOption[ key ]; 646 | } 647 | curOption[ key ] = value; 648 | } else { 649 | if ( arguments.length === 1 ) { 650 | return this.options[ key ] === undefined ? null : this.options[ key ]; 651 | } 652 | options[ key ] = value; 653 | } 654 | } 655 | 656 | this._setOptions( options ); 657 | 658 | return this; 659 | }, 660 | _setOptions: function( options ) { 661 | var key; 662 | 663 | for ( key in options ) { 664 | this._setOption( key, options[ key ] ); 665 | } 666 | 667 | return this; 668 | }, 669 | _setOption: function( key, value ) { 670 | this.options[ key ] = value; 671 | 672 | if ( key === "disabled" ) { 673 | this.widget() 674 | .toggleClass( this.widgetFullName + "-disabled", !!value ); 675 | 676 | // If the widget is becoming disabled, then nothing is interactive 677 | if ( value ) { 678 | this.hoverable.removeClass( "ui-state-hover" ); 679 | this.focusable.removeClass( "ui-state-focus" ); 680 | } 681 | } 682 | 683 | return this; 684 | }, 685 | 686 | enable: function() { 687 | return this._setOptions({ disabled: false }); 688 | }, 689 | disable: function() { 690 | return this._setOptions({ disabled: true }); 691 | }, 692 | 693 | _on: function( suppressDisabledCheck, element, handlers ) { 694 | var delegateElement, 695 | instance = this; 696 | 697 | // no suppressDisabledCheck flag, shuffle arguments 698 | if ( typeof suppressDisabledCheck !== "boolean" ) { 699 | handlers = element; 700 | element = suppressDisabledCheck; 701 | suppressDisabledCheck = false; 702 | } 703 | 704 | // no element argument, shuffle and use this.element 705 | if ( !handlers ) { 706 | handlers = element; 707 | element = this.element; 708 | delegateElement = this.widget(); 709 | } else { 710 | element = delegateElement = $( element ); 711 | this.bindings = this.bindings.add( element ); 712 | } 713 | 714 | $.each( handlers, function( event, handler ) { 715 | function handlerProxy() { 716 | // allow widgets to customize the disabled handling 717 | // - disabled as an array instead of boolean 718 | // - disabled class as method for disabling individual parts 719 | if ( !suppressDisabledCheck && 720 | ( instance.options.disabled === true || 721 | $( this ).hasClass( "ui-state-disabled" ) ) ) { 722 | return; 723 | } 724 | return ( typeof handler === "string" ? instance[ handler ] : handler ) 725 | .apply( instance, arguments ); 726 | } 727 | 728 | // copy the guid so direct unbinding works 729 | if ( typeof handler !== "string" ) { 730 | handlerProxy.guid = handler.guid = 731 | handler.guid || handlerProxy.guid || $.guid++; 732 | } 733 | 734 | var match = event.match( /^([\w:-]*)\s*(.*)$/ ), 735 | eventName = match[1] + instance.eventNamespace, 736 | selector = match[2]; 737 | if ( selector ) { 738 | delegateElement.delegate( selector, eventName, handlerProxy ); 739 | } else { 740 | element.bind( eventName, handlerProxy ); 741 | } 742 | }); 743 | }, 744 | 745 | _off: function( element, eventName ) { 746 | eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + 747 | this.eventNamespace; 748 | element.unbind( eventName ).undelegate( eventName ); 749 | 750 | // Clear the stack to avoid memory leaks (#10056) 751 | this.bindings = $( this.bindings.not( element ).get() ); 752 | this.focusable = $( this.focusable.not( element ).get() ); 753 | this.hoverable = $( this.hoverable.not( element ).get() ); 754 | }, 755 | 756 | _delay: function( handler, delay ) { 757 | function handlerProxy() { 758 | return ( typeof handler === "string" ? instance[ handler ] : handler ) 759 | .apply( instance, arguments ); 760 | } 761 | var instance = this; 762 | return setTimeout( handlerProxy, delay || 0 ); 763 | }, 764 | 765 | _hoverable: function( element ) { 766 | this.hoverable = this.hoverable.add( element ); 767 | this._on( element, { 768 | mouseenter: function( event ) { 769 | $( event.currentTarget ).addClass( "ui-state-hover" ); 770 | }, 771 | mouseleave: function( event ) { 772 | $( event.currentTarget ).removeClass( "ui-state-hover" ); 773 | } 774 | }); 775 | }, 776 | 777 | _focusable: function( element ) { 778 | this.focusable = this.focusable.add( element ); 779 | this._on( element, { 780 | focusin: function( event ) { 781 | $( event.currentTarget ).addClass( "ui-state-focus" ); 782 | }, 783 | focusout: function( event ) { 784 | $( event.currentTarget ).removeClass( "ui-state-focus" ); 785 | } 786 | }); 787 | }, 788 | 789 | _trigger: function( type, event, data ) { 790 | var prop, orig, 791 | callback = this.options[ type ]; 792 | 793 | data = data || {}; 794 | event = $.Event( event ); 795 | event.type = ( type === this.widgetEventPrefix ? 796 | type : 797 | this.widgetEventPrefix + type ).toLowerCase(); 798 | // the original event may come from any element 799 | // so we need to reset the target on the new event 800 | event.target = this.element[ 0 ]; 801 | 802 | // copy original event properties over to the new event 803 | orig = event.originalEvent; 804 | if ( orig ) { 805 | for ( prop in orig ) { 806 | if ( !( prop in event ) ) { 807 | event[ prop ] = orig[ prop ]; 808 | } 809 | } 810 | } 811 | 812 | this.element.trigger( event, data ); 813 | return !( $.isFunction( callback ) && 814 | callback.apply( this.element[0], [ event ].concat( data ) ) === false || 815 | event.isDefaultPrevented() ); 816 | } 817 | }; 818 | 819 | $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { 820 | $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { 821 | if ( typeof options === "string" ) { 822 | options = { effect: options }; 823 | } 824 | var hasOptions, 825 | effectName = !options ? 826 | method : 827 | options === true || typeof options === "number" ? 828 | defaultEffect : 829 | options.effect || defaultEffect; 830 | options = options || {}; 831 | if ( typeof options === "number" ) { 832 | options = { duration: options }; 833 | } 834 | hasOptions = !$.isEmptyObject( options ); 835 | options.complete = callback; 836 | if ( options.delay ) { 837 | element.delay( options.delay ); 838 | } 839 | if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { 840 | element[ method ]( options ); 841 | } else if ( effectName !== method && element[ effectName ] ) { 842 | element[ effectName ]( options.duration, options.easing, callback ); 843 | } else { 844 | element.queue(function( next ) { 845 | $( this )[ method ](); 846 | if ( callback ) { 847 | callback.call( element[ 0 ] ); 848 | } 849 | next(); 850 | }); 851 | } 852 | }; 853 | }); 854 | 855 | var widget = $.widget; 856 | 857 | 858 | /*! 859 | * jQuery UI Position 1.11.2 860 | * http://jqueryui.com 861 | * 862 | * Copyright 2014 jQuery Foundation and other contributors 863 | * Released under the MIT license. 864 | * http://jquery.org/license 865 | * 866 | * http://api.jqueryui.com/position/ 867 | */ 868 | 869 | (function() { 870 | 871 | $.ui = $.ui || {}; 872 | 873 | var cachedScrollbarWidth, supportsOffsetFractions, 874 | max = Math.max, 875 | abs = Math.abs, 876 | round = Math.round, 877 | rhorizontal = /left|center|right/, 878 | rvertical = /top|center|bottom/, 879 | roffset = /[\+\-]\d+(\.[\d]+)?%?/, 880 | rposition = /^\w+/, 881 | rpercent = /%$/, 882 | _position = $.fn.position; 883 | 884 | function getOffsets( offsets, width, height ) { 885 | return [ 886 | parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), 887 | parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) 888 | ]; 889 | } 890 | 891 | function parseCss( element, property ) { 892 | return parseInt( $.css( element, property ), 10 ) || 0; 893 | } 894 | 895 | function getDimensions( elem ) { 896 | var raw = elem[0]; 897 | if ( raw.nodeType === 9 ) { 898 | return { 899 | width: elem.width(), 900 | height: elem.height(), 901 | offset: { top: 0, left: 0 } 902 | }; 903 | } 904 | if ( $.isWindow( raw ) ) { 905 | return { 906 | width: elem.width(), 907 | height: elem.height(), 908 | offset: { top: elem.scrollTop(), left: elem.scrollLeft() } 909 | }; 910 | } 911 | if ( raw.preventDefault ) { 912 | return { 913 | width: 0, 914 | height: 0, 915 | offset: { top: raw.pageY, left: raw.pageX } 916 | }; 917 | } 918 | return { 919 | width: elem.outerWidth(), 920 | height: elem.outerHeight(), 921 | offset: elem.offset() 922 | }; 923 | } 924 | 925 | $.position = { 926 | scrollbarWidth: function() { 927 | if ( cachedScrollbarWidth !== undefined ) { 928 | return cachedScrollbarWidth; 929 | } 930 | var w1, w2, 931 | div = $( "
" ), 932 | innerDiv = div.children()[0]; 933 | 934 | $( "body" ).append( div ); 935 | w1 = innerDiv.offsetWidth; 936 | div.css( "overflow", "scroll" ); 937 | 938 | w2 = innerDiv.offsetWidth; 939 | 940 | if ( w1 === w2 ) { 941 | w2 = div[0].clientWidth; 942 | } 943 | 944 | div.remove(); 945 | 946 | return (cachedScrollbarWidth = w1 - w2); 947 | }, 948 | getScrollInfo: function( within ) { 949 | var overflowX = within.isWindow || within.isDocument ? "" : 950 | within.element.css( "overflow-x" ), 951 | overflowY = within.isWindow || within.isDocument ? "" : 952 | within.element.css( "overflow-y" ), 953 | hasOverflowX = overflowX === "scroll" || 954 | ( overflowX === "auto" && within.width < within.element[0].scrollWidth ), 955 | hasOverflowY = overflowY === "scroll" || 956 | ( overflowY === "auto" && within.height < within.element[0].scrollHeight ); 957 | return { 958 | width: hasOverflowY ? $.position.scrollbarWidth() : 0, 959 | height: hasOverflowX ? $.position.scrollbarWidth() : 0 960 | }; 961 | }, 962 | getWithinInfo: function( element ) { 963 | var withinElement = $( element || window ), 964 | isWindow = $.isWindow( withinElement[0] ), 965 | isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9; 966 | return { 967 | element: withinElement, 968 | isWindow: isWindow, 969 | isDocument: isDocument, 970 | offset: withinElement.offset() || { left: 0, top: 0 }, 971 | scrollLeft: withinElement.scrollLeft(), 972 | scrollTop: withinElement.scrollTop(), 973 | 974 | // support: jQuery 1.6.x 975 | // jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows 976 | width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(), 977 | height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight() 978 | }; 979 | } 980 | }; 981 | 982 | $.fn.position = function( options ) { 983 | if ( !options || !options.of ) { 984 | return _position.apply( this, arguments ); 985 | } 986 | 987 | // make a copy, we don't want to modify arguments 988 | options = $.extend( {}, options ); 989 | 990 | var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, 991 | target = $( options.of ), 992 | within = $.position.getWithinInfo( options.within ), 993 | scrollInfo = $.position.getScrollInfo( within ), 994 | collision = ( options.collision || "flip" ).split( " " ), 995 | offsets = {}; 996 | 997 | dimensions = getDimensions( target ); 998 | if ( target[0].preventDefault ) { 999 | // force left top to allow flipping 1000 | options.at = "left top"; 1001 | } 1002 | targetWidth = dimensions.width; 1003 | targetHeight = dimensions.height; 1004 | targetOffset = dimensions.offset; 1005 | // clone to reuse original targetOffset later 1006 | basePosition = $.extend( {}, targetOffset ); 1007 | 1008 | // force my and at to have valid horizontal and vertical positions 1009 | // if a value is missing or invalid, it will be converted to center 1010 | $.each( [ "my", "at" ], function() { 1011 | var pos = ( options[ this ] || "" ).split( " " ), 1012 | horizontalOffset, 1013 | verticalOffset; 1014 | 1015 | if ( pos.length === 1) { 1016 | pos = rhorizontal.test( pos[ 0 ] ) ? 1017 | pos.concat( [ "center" ] ) : 1018 | rvertical.test( pos[ 0 ] ) ? 1019 | [ "center" ].concat( pos ) : 1020 | [ "center", "center" ]; 1021 | } 1022 | pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; 1023 | pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; 1024 | 1025 | // calculate offsets 1026 | horizontalOffset = roffset.exec( pos[ 0 ] ); 1027 | verticalOffset = roffset.exec( pos[ 1 ] ); 1028 | offsets[ this ] = [ 1029 | horizontalOffset ? horizontalOffset[ 0 ] : 0, 1030 | verticalOffset ? verticalOffset[ 0 ] : 0 1031 | ]; 1032 | 1033 | // reduce to just the positions without the offsets 1034 | options[ this ] = [ 1035 | rposition.exec( pos[ 0 ] )[ 0 ], 1036 | rposition.exec( pos[ 1 ] )[ 0 ] 1037 | ]; 1038 | }); 1039 | 1040 | // normalize collision option 1041 | if ( collision.length === 1 ) { 1042 | collision[ 1 ] = collision[ 0 ]; 1043 | } 1044 | 1045 | if ( options.at[ 0 ] === "right" ) { 1046 | basePosition.left += targetWidth; 1047 | } else if ( options.at[ 0 ] === "center" ) { 1048 | basePosition.left += targetWidth / 2; 1049 | } 1050 | 1051 | if ( options.at[ 1 ] === "bottom" ) { 1052 | basePosition.top += targetHeight; 1053 | } else if ( options.at[ 1 ] === "center" ) { 1054 | basePosition.top += targetHeight / 2; 1055 | } 1056 | 1057 | atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); 1058 | basePosition.left += atOffset[ 0 ]; 1059 | basePosition.top += atOffset[ 1 ]; 1060 | 1061 | return this.each(function() { 1062 | var collisionPosition, using, 1063 | elem = $( this ), 1064 | elemWidth = elem.outerWidth(), 1065 | elemHeight = elem.outerHeight(), 1066 | marginLeft = parseCss( this, "marginLeft" ), 1067 | marginTop = parseCss( this, "marginTop" ), 1068 | collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width, 1069 | collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height, 1070 | position = $.extend( {}, basePosition ), 1071 | myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); 1072 | 1073 | if ( options.my[ 0 ] === "right" ) { 1074 | position.left -= elemWidth; 1075 | } else if ( options.my[ 0 ] === "center" ) { 1076 | position.left -= elemWidth / 2; 1077 | } 1078 | 1079 | if ( options.my[ 1 ] === "bottom" ) { 1080 | position.top -= elemHeight; 1081 | } else if ( options.my[ 1 ] === "center" ) { 1082 | position.top -= elemHeight / 2; 1083 | } 1084 | 1085 | position.left += myOffset[ 0 ]; 1086 | position.top += myOffset[ 1 ]; 1087 | 1088 | // if the browser doesn't support fractions, then round for consistent results 1089 | if ( !supportsOffsetFractions ) { 1090 | position.left = round( position.left ); 1091 | position.top = round( position.top ); 1092 | } 1093 | 1094 | collisionPosition = { 1095 | marginLeft: marginLeft, 1096 | marginTop: marginTop 1097 | }; 1098 | 1099 | $.each( [ "left", "top" ], function( i, dir ) { 1100 | if ( $.ui.position[ collision[ i ] ] ) { 1101 | $.ui.position[ collision[ i ] ][ dir ]( position, { 1102 | targetWidth: targetWidth, 1103 | targetHeight: targetHeight, 1104 | elemWidth: elemWidth, 1105 | elemHeight: elemHeight, 1106 | collisionPosition: collisionPosition, 1107 | collisionWidth: collisionWidth, 1108 | collisionHeight: collisionHeight, 1109 | offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], 1110 | my: options.my, 1111 | at: options.at, 1112 | within: within, 1113 | elem: elem 1114 | }); 1115 | } 1116 | }); 1117 | 1118 | if ( options.using ) { 1119 | // adds feedback as second argument to using callback, if present 1120 | using = function( props ) { 1121 | var left = targetOffset.left - position.left, 1122 | right = left + targetWidth - elemWidth, 1123 | top = targetOffset.top - position.top, 1124 | bottom = top + targetHeight - elemHeight, 1125 | feedback = { 1126 | target: { 1127 | element: target, 1128 | left: targetOffset.left, 1129 | top: targetOffset.top, 1130 | width: targetWidth, 1131 | height: targetHeight 1132 | }, 1133 | element: { 1134 | element: elem, 1135 | left: position.left, 1136 | top: position.top, 1137 | width: elemWidth, 1138 | height: elemHeight 1139 | }, 1140 | horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", 1141 | vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" 1142 | }; 1143 | if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { 1144 | feedback.horizontal = "center"; 1145 | } 1146 | if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { 1147 | feedback.vertical = "middle"; 1148 | } 1149 | if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { 1150 | feedback.important = "horizontal"; 1151 | } else { 1152 | feedback.important = "vertical"; 1153 | } 1154 | options.using.call( this, props, feedback ); 1155 | }; 1156 | } 1157 | 1158 | elem.offset( $.extend( position, { using: using } ) ); 1159 | }); 1160 | }; 1161 | 1162 | $.ui.position = { 1163 | fit: { 1164 | left: function( position, data ) { 1165 | var within = data.within, 1166 | withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, 1167 | outerWidth = within.width, 1168 | collisionPosLeft = position.left - data.collisionPosition.marginLeft, 1169 | overLeft = withinOffset - collisionPosLeft, 1170 | overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, 1171 | newOverRight; 1172 | 1173 | // element is wider than within 1174 | if ( data.collisionWidth > outerWidth ) { 1175 | // element is initially over the left side of within 1176 | if ( overLeft > 0 && overRight <= 0 ) { 1177 | newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; 1178 | position.left += overLeft - newOverRight; 1179 | // element is initially over right side of within 1180 | } else if ( overRight > 0 && overLeft <= 0 ) { 1181 | position.left = withinOffset; 1182 | // element is initially over both left and right sides of within 1183 | } else { 1184 | if ( overLeft > overRight ) { 1185 | position.left = withinOffset + outerWidth - data.collisionWidth; 1186 | } else { 1187 | position.left = withinOffset; 1188 | } 1189 | } 1190 | // too far left -> align with left edge 1191 | } else if ( overLeft > 0 ) { 1192 | position.left += overLeft; 1193 | // too far right -> align with right edge 1194 | } else if ( overRight > 0 ) { 1195 | position.left -= overRight; 1196 | // adjust based on position and margin 1197 | } else { 1198 | position.left = max( position.left - collisionPosLeft, position.left ); 1199 | } 1200 | }, 1201 | top: function( position, data ) { 1202 | var within = data.within, 1203 | withinOffset = within.isWindow ? within.scrollTop : within.offset.top, 1204 | outerHeight = data.within.height, 1205 | collisionPosTop = position.top - data.collisionPosition.marginTop, 1206 | overTop = withinOffset - collisionPosTop, 1207 | overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, 1208 | newOverBottom; 1209 | 1210 | // element is taller than within 1211 | if ( data.collisionHeight > outerHeight ) { 1212 | // element is initially over the top of within 1213 | if ( overTop > 0 && overBottom <= 0 ) { 1214 | newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; 1215 | position.top += overTop - newOverBottom; 1216 | // element is initially over bottom of within 1217 | } else if ( overBottom > 0 && overTop <= 0 ) { 1218 | position.top = withinOffset; 1219 | // element is initially over both top and bottom of within 1220 | } else { 1221 | if ( overTop > overBottom ) { 1222 | position.top = withinOffset + outerHeight - data.collisionHeight; 1223 | } else { 1224 | position.top = withinOffset; 1225 | } 1226 | } 1227 | // too far up -> align with top 1228 | } else if ( overTop > 0 ) { 1229 | position.top += overTop; 1230 | // too far down -> align with bottom edge 1231 | } else if ( overBottom > 0 ) { 1232 | position.top -= overBottom; 1233 | // adjust based on position and margin 1234 | } else { 1235 | position.top = max( position.top - collisionPosTop, position.top ); 1236 | } 1237 | } 1238 | }, 1239 | flip: { 1240 | left: function( position, data ) { 1241 | var within = data.within, 1242 | withinOffset = within.offset.left + within.scrollLeft, 1243 | outerWidth = within.width, 1244 | offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, 1245 | collisionPosLeft = position.left - data.collisionPosition.marginLeft, 1246 | overLeft = collisionPosLeft - offsetLeft, 1247 | overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, 1248 | myOffset = data.my[ 0 ] === "left" ? 1249 | -data.elemWidth : 1250 | data.my[ 0 ] === "right" ? 1251 | data.elemWidth : 1252 | 0, 1253 | atOffset = data.at[ 0 ] === "left" ? 1254 | data.targetWidth : 1255 | data.at[ 0 ] === "right" ? 1256 | -data.targetWidth : 1257 | 0, 1258 | offset = -2 * data.offset[ 0 ], 1259 | newOverRight, 1260 | newOverLeft; 1261 | 1262 | if ( overLeft < 0 ) { 1263 | newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; 1264 | if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { 1265 | position.left += myOffset + atOffset + offset; 1266 | } 1267 | } else if ( overRight > 0 ) { 1268 | newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; 1269 | if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { 1270 | position.left += myOffset + atOffset + offset; 1271 | } 1272 | } 1273 | }, 1274 | top: function( position, data ) { 1275 | var within = data.within, 1276 | withinOffset = within.offset.top + within.scrollTop, 1277 | outerHeight = within.height, 1278 | offsetTop = within.isWindow ? within.scrollTop : within.offset.top, 1279 | collisionPosTop = position.top - data.collisionPosition.marginTop, 1280 | overTop = collisionPosTop - offsetTop, 1281 | overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, 1282 | top = data.my[ 1 ] === "top", 1283 | myOffset = top ? 1284 | -data.elemHeight : 1285 | data.my[ 1 ] === "bottom" ? 1286 | data.elemHeight : 1287 | 0, 1288 | atOffset = data.at[ 1 ] === "top" ? 1289 | data.targetHeight : 1290 | data.at[ 1 ] === "bottom" ? 1291 | -data.targetHeight : 1292 | 0, 1293 | offset = -2 * data.offset[ 1 ], 1294 | newOverTop, 1295 | newOverBottom; 1296 | if ( overTop < 0 ) { 1297 | newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; 1298 | if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) { 1299 | position.top += myOffset + atOffset + offset; 1300 | } 1301 | } else if ( overBottom > 0 ) { 1302 | newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; 1303 | if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) { 1304 | position.top += myOffset + atOffset + offset; 1305 | } 1306 | } 1307 | } 1308 | }, 1309 | flipfit: { 1310 | left: function() { 1311 | $.ui.position.flip.left.apply( this, arguments ); 1312 | $.ui.position.fit.left.apply( this, arguments ); 1313 | }, 1314 | top: function() { 1315 | $.ui.position.flip.top.apply( this, arguments ); 1316 | $.ui.position.fit.top.apply( this, arguments ); 1317 | } 1318 | } 1319 | }; 1320 | 1321 | // fraction support test 1322 | (function() { 1323 | var testElement, testElementParent, testElementStyle, offsetLeft, i, 1324 | body = document.getElementsByTagName( "body" )[ 0 ], 1325 | div = document.createElement( "div" ); 1326 | 1327 | //Create a "fake body" for testing based on method used in jQuery.support 1328 | testElement = document.createElement( body ? "div" : "body" ); 1329 | testElementStyle = { 1330 | visibility: "hidden", 1331 | width: 0, 1332 | height: 0, 1333 | border: 0, 1334 | margin: 0, 1335 | background: "none" 1336 | }; 1337 | if ( body ) { 1338 | $.extend( testElementStyle, { 1339 | position: "absolute", 1340 | left: "-1000px", 1341 | top: "-1000px" 1342 | }); 1343 | } 1344 | for ( i in testElementStyle ) { 1345 | testElement.style[ i ] = testElementStyle[ i ]; 1346 | } 1347 | testElement.appendChild( div ); 1348 | testElementParent = body || document.documentElement; 1349 | testElementParent.insertBefore( testElement, testElementParent.firstChild ); 1350 | 1351 | div.style.cssText = "position: absolute; left: 10.7432222px;"; 1352 | 1353 | offsetLeft = $( div ).offset().left; 1354 | supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11; 1355 | 1356 | testElement.innerHTML = ""; 1357 | testElementParent.removeChild( testElement ); 1358 | })(); 1359 | 1360 | })(); 1361 | 1362 | var position = $.ui.position; 1363 | 1364 | 1365 | /*! 1366 | * jQuery UI Menu 1.11.2 1367 | * http://jqueryui.com 1368 | * 1369 | * Copyright 2014 jQuery Foundation and other contributors 1370 | * Released under the MIT license. 1371 | * http://jquery.org/license 1372 | * 1373 | * http://api.jqueryui.com/menu/ 1374 | */ 1375 | 1376 | 1377 | var menu = $.widget( "ui.menu", { 1378 | version: "1.11.2", 1379 | defaultElement: "