Skip to content

Commit ebd9fda

Browse files
author
Caleb Everett
committed
Added a new snippet
The new snipped called jqOnSel creates a $(document).on('event', 'selector', function(){}) block.
1 parent 6756a09 commit ebd9fda

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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>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>
11+
<HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
12+
<Shortcut>jqOn</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 and optional namespaces, such as "click" or "keydown.myPlugin".</ToolTip>
26+
<Default>events</Default>
27+
<Function>
28+
</Function>
29+
</Literal>
30+
</Declarations>
31+
<Code Language="javascript"><![CDATA[$$(document).on($events$, $selector$, function () {
32+
$end$
33+
});]]></Code>
34+
</Snippet>
35+
</CodeSnippet>
36+
</CodeSnippets>

jQueryCodeSnippets/jQueryCodeSnippets.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@
455455
</Content>
456456
<Content Include="JavaScript\jQuery\jqSlideToggle.snippet" />
457457
<Content Include="JavaScript\jQuery\jqSlideToggleFull.snippet" />
458+
<Content Include="JavaScript\jQuery\jqOnSel.snippet" />
458459
<None Include="source.extension.vsixmanifest">
459460
<SubType>Designer</SubType>
460461
</None>

0 commit comments

Comments
 (0)