mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
Add definition for "jquery.dropotron".
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
/// <reference path="jquery.dropotron.d.ts" />
|
||||
|
||||
/**
|
||||
* @summary Test for "dropotron" without configurations.
|
||||
*/
|
||||
function testDropotron() {
|
||||
var foo: JQuery = $('#main-nav > ul');
|
||||
foo.dropotron();
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for "dropotron" with configurations.
|
||||
*/
|
||||
function testDropotronConfiguration() {
|
||||
var config: DropotronConfiguration = {
|
||||
selectorParent: null,
|
||||
baseZIndex: 1000,
|
||||
menuClass: 'dropotron',
|
||||
expandMode: 'hover',
|
||||
hoverDelay: 150,
|
||||
hideDelay: 250,
|
||||
openerClass: 'opener',
|
||||
openerActiveClass: 'active',
|
||||
submenuClassPrefix: 'level-',
|
||||
mode: 'fade',
|
||||
speed: 'fast',
|
||||
easing: 'swing',
|
||||
alignment: 'left',
|
||||
offsetX: 0,
|
||||
offsetY: 0,
|
||||
globalOffsetY: 0,
|
||||
IEOffsetX: 0,
|
||||
IEOffsetY: 0,
|
||||
noOpenerFade: true,
|
||||
detach: true,
|
||||
cloneOnDetach: true
|
||||
};
|
||||
|
||||
var foo: JQuery = $('#main-nav > ul');
|
||||
foo.dropotron(config);
|
||||
}
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
// Type definitions for jquery.dropotron 1.4.3
|
||||
// Project: https://github.com/n33/jquery.dropotron
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped/
|
||||
|
||||
/**
|
||||
* @summary Interface for "dropotron" configurations.
|
||||
* @author Cyril Schumacher
|
||||
* @version 1.0
|
||||
*/
|
||||
interface DropotronConfiguration {
|
||||
|
||||
/**
|
||||
* @summary Alignment ("left", "center", "right").
|
||||
* @type {string}
|
||||
*/
|
||||
alignment: string;
|
||||
|
||||
/**
|
||||
* @summary Base Z-Index.
|
||||
* @type {number}
|
||||
*/
|
||||
baseZIndex: number;
|
||||
|
||||
/**
|
||||
* @summary If true and detach = true, leave original menu intact.
|
||||
* @type {boolean}
|
||||
*/
|
||||
cloneOnDetach: boolean;
|
||||
|
||||
/**
|
||||
* @summary Detach second level menus (prevents parent style bleed).
|
||||
* @type {boolean}
|
||||
*/
|
||||
detach: boolean;
|
||||
|
||||
/**
|
||||
* @summary Easing mode ("swing", "linear").
|
||||
* @type {string}
|
||||
*/
|
||||
easing: string;
|
||||
|
||||
/**
|
||||
* @summary IE Offset X.
|
||||
* @type {number}
|
||||
*/
|
||||
IEOffsetX: number;
|
||||
|
||||
/**
|
||||
* @summary IE Offset Y.
|
||||
* @type {number}
|
||||
*/
|
||||
IEOffsetY: number;
|
||||
|
||||
/**
|
||||
* @summary Expansion mode ("hover" or "click").
|
||||
* @type {string}
|
||||
*/
|
||||
expandMode: string;
|
||||
|
||||
/**
|
||||
* @summary Global offset Y.
|
||||
* @type {number}
|
||||
*/
|
||||
globalOffsetY: number;
|
||||
|
||||
/**
|
||||
* @summary Hide delay (in ms; 0 disables).
|
||||
* @type {number}
|
||||
*/
|
||||
hideDelay: number;
|
||||
|
||||
/**
|
||||
* @summary Hover delay (in ms).
|
||||
* @type {number}
|
||||
*/
|
||||
hoverDelay: number;
|
||||
|
||||
/**
|
||||
* @summary Menu class (assigned to every <ul>).
|
||||
* @type {string}
|
||||
*/
|
||||
menuClass: string;
|
||||
|
||||
/**
|
||||
* @summary Menu mode ("instant", "fade", "slide", "zoom").
|
||||
* @type {string}
|
||||
*/
|
||||
mode: string;
|
||||
|
||||
/**
|
||||
* @summary If true and mode = "fade", prevents top-level opener fade.
|
||||
* @type {boolean}
|
||||
*/
|
||||
noOpenerFade: boolean;
|
||||
|
||||
/**
|
||||
* @summary Submenu offset X.
|
||||
* @type {number}
|
||||
*/
|
||||
offsetX: number;
|
||||
|
||||
/**
|
||||
* @summary Submenu offset Y.
|
||||
* @type {number}
|
||||
*/
|
||||
offsetY: number;
|
||||
|
||||
/**
|
||||
* @summary Active opener class.
|
||||
* @type {string}
|
||||
*/
|
||||
openerActiveClass: string;
|
||||
|
||||
/**
|
||||
* @summary Opener class.
|
||||
* @type {number}
|
||||
*/
|
||||
openerClass: number;
|
||||
|
||||
/**
|
||||
* @summary Parent jQuery object.
|
||||
* @type {JQuery}
|
||||
*/
|
||||
selectorParent: JQuery;
|
||||
|
||||
/**
|
||||
* @summary Menu speed ("fast", "slow", or ms).
|
||||
* @type {string}
|
||||
*/
|
||||
speed: string;
|
||||
|
||||
/**
|
||||
* @summary Submenu class prefix.
|
||||
* @type {string}
|
||||
*/
|
||||
submenuClassPrefix: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Interface for "dropotron".
|
||||
* @author Cyril Schumacher
|
||||
* @version 1.0
|
||||
*/
|
||||
interface Dropotron {
|
||||
/**
|
||||
* @summary Adds multilevel dropdown menus to jQuery.
|
||||
* @param {DropotronConfiguration} config Optional. Configuration.
|
||||
*/
|
||||
(config?: DropotronConfiguration): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Interface for "JQuery".
|
||||
* @author Cyril Schumacher
|
||||
* @version 1.0
|
||||
*/
|
||||
interface JQuery {
|
||||
dropotron: Dropotron;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
--noImplicitAny
|
||||
Reference in New Issue
Block a user