Skip to content

Commit 12c359f

Browse files
author
Caleb Everett
committed
Fixed conflict in naming and added Off/OffSel
1 parent ebd9fda commit 12c359f

File tree

4 files changed

+74
-4
lines changed

4 files changed

+74
-4
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
3+
<CodeSnippet Format="1.5.0">
4+
<Header>
5+
<SnippetTypes>
6+
<SnippetType>Expansion</SnippetType>
7+
</SnippetTypes>
8+
<Title>jqOff</Title>
9+
<Author>Caleb Everett (github.com/everettcaleb)</Author>
10+
<Description>Detach an event handler from one or more events on the selected elements.</Description>
11+
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqOff</Shortcut>
13+
</Header>
14+
<Snippet>
15+
<Declarations>
16+
<Literal Editable="true">
17+
<ID>selector</ID>
18+
<ToolTip>Element(s) to bind to</ToolTip>
19+
<Default>selector</Default>
20+
<Function>
21+
</Function>
22+
</Literal>
23+
<Literal Editable="true">
24+
<ID>events</ID>
25+
<ToolTip>One or more space-separated event types or namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".</ToolTip>
26+
<Default>events</Default>
27+
<Function>
28+
</Function>
29+
</Literal>
30+
</Declarations>
31+
<Code Language="javascript"><![CDATA[$$($selector$).off($events$);]]></Code>
32+
</Snippet>
33+
</CodeSnippet>
34+
</CodeSnippets>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
3+
<CodeSnippet Format="1.5.0">
4+
<Header>
5+
<SnippetTypes>
6+
<SnippetType>Expansion</SnippetType>
7+
</SnippetTypes>
8+
<Title>jqOffSel</Title>
9+
<Author>Caleb Everett (github.com/everettcaleb)</Author>
10+
<Description>Detach an event handler from one or more events on the document with the specified selector.</Description>
11+
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqOffSel</Shortcut>
13+
</Header>
14+
<Snippet>
15+
<Declarations>
16+
<Literal Editable="true">
17+
<ID>selector</ID>
18+
<ToolTip>Element(s) to bind to</ToolTip>
19+
<Default>selector</Default>
20+
<Function>
21+
</Function>
22+
</Literal>
23+
<Literal Editable="true">
24+
<ID>events</ID>
25+
<ToolTip>One or more space-separated event types or namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".</ToolTip>
26+
<Default>events</Default>
27+
<Function>
28+
</Function>
29+
</Literal>
30+
</Declarations>
31+
<Code Language="javascript"><![CDATA[$$(document).off($events$, $selector$);]]></Code>
32+
</Snippet>
33+
</CodeSnippet>
34+
</CodeSnippets>

jQueryCodeSnippets/JavaScript/jQuery/jqOnSel.snippet

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<SnippetTypes>
66
<SnippetType>Expansion</SnippetType>
77
</SnippetTypes>
8-
<Title>jqOn</Title>
9-
<Author>Kyle Spearrin (www.kylespearrin.com)</Author>
10-
<Description>Attach an event handler function for one or more events to the selected elements.</Description>
8+
<Title>jqOnSel</Title>
9+
<Author>Caleb Everett (github.com/everettcaleb)</Author>
10+
<Description>Attach an event handler function for one or more events to the document filtered by the selector.</Description>
1111
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12-
<Shortcut>jqOn</Shortcut>
12+
<Shortcut>jqOnSel</Shortcut>
1313
</Header>
1414
<Snippet>
1515
<Declarations>

jQueryCodeSnippets/jQueryCodeSnippets.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,8 @@
456456
<Content Include="JavaScript\jQuery\jqSlideToggle.snippet" />
457457
<Content Include="JavaScript\jQuery\jqSlideToggleFull.snippet" />
458458
<Content Include="JavaScript\jQuery\jqOnSel.snippet" />
459+
<Content Include="JavaScript\jQuery\jqOff.snippet" />
460+
<Content Include="JavaScript\jQuery\jqOffSel.snippet" />
459461
<None Include="source.extension.vsixmanifest">
460462
<SubType>Designer</SubType>
461463
</None>

0 commit comments

Comments
 (0)