mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
jquery addBack() method added #316
This commit is contained in:
@@ -2240,3 +2240,15 @@ $('#item').click(function(e) {
|
||||
if (e.ctrlKey) { console.log('control pressed'); }
|
||||
if (e.altKey) { console.log('alt pressed'); }
|
||||
});
|
||||
|
||||
function test_addBack() {
|
||||
$('li.third-item').nextAll().addBack().css('background-color', 'red');
|
||||
|
||||
$("div.left, div.right").find("div, div > p").addClass("border");
|
||||
|
||||
// First Example
|
||||
$("div.before-addback").find("p").addClass("background");
|
||||
|
||||
// Second Example
|
||||
$("div.after-addback").find("p").addBack().addClass("background");
|
||||
}
|
||||
9
jquery/jquery.d.ts
vendored
9
jquery/jquery.d.ts
vendored
@@ -274,7 +274,10 @@ interface JQueryStatic {
|
||||
*******/
|
||||
proxy(fn : (...args: any[]) => any, context: any, ...args: any[]): any;
|
||||
proxy(context: any, name: string, ...args: any[]): any;
|
||||
Deferred(fn? : (d: JQueryDeferred) => any): JQueryDeferred;
|
||||
Deferred: {
|
||||
(fn?: (d: JQueryDeferred) => any): JQueryDeferred;
|
||||
new(fn?: (d: JQueryDeferred) => any): JQueryDeferred;
|
||||
};
|
||||
Event(name:string, eventProperties?:any): JQueryEventObject;
|
||||
|
||||
/*********
|
||||
@@ -371,6 +374,10 @@ interface JQuery {
|
||||
addClass(classNames: string): JQuery;
|
||||
addClass(func: (index: any, currentClass: any) => string): JQuery;
|
||||
|
||||
// http://api.jquery.com/addBack/
|
||||
addBack(selector?: string): JQuery;
|
||||
|
||||
|
||||
attr(attributeName: string): string;
|
||||
attr(attributeName: string, value: any): JQuery;
|
||||
attr(map: { [key: string]: any; }): JQuery;
|
||||
|
||||
Reference in New Issue
Block a user