forked from tforsberg/Frameworks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScrollSpy.cs
111 lines (103 loc) · 3.33 KB
/
ScrollSpy.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
using Bridge.jQuery2;
namespace Bridge.Bootstrap3
{
[External]
public static partial class Bootstrap
{
/// <summary>
/// Adds the ScrollSpy behavior on the element.
/// </summary>
/// <param name="instance">The jQuery object to spy scroll on</param>
/// <param name="options">The ScrollSpy options - a target (nav) and an offset</param>
/// <returns>The jQuery object</returns>
[Template("{0}.scrollspy({1})")]
public static jQuery ScrollSpy(this jQuery instance, ScrollSpyOptions options)
{
return null;
}
/// <summary>
/// Calls the ScrollSpy operation. The only operation is supported - "refresh".
/// </summary>
/// <param name="instance">The jQuery object with a ScrollSpy</param>
/// <param name="operation">The operation. Only "refresh" is supported.</param>
/// <returns>The jQuery object</returns>
[Template("{0}.scrollspy({1})")]
public static jQuery ScrollSpy(this jQuery instance, string operation)
{
return null;
}
/// <summary>
/// Calls the ScrollSpy operation. The only operation is supported - "refresh".
/// </summary>
/// <param name="instance">The jQuery object with a ScrollSpy</param>
/// <param name="operation">The operation. Only "refresh" is supported.</param>
/// <returns>The jQuery object</returns>
[Template("{0}.scrollspy({1})")]
public static jQuery ScrollSpy(this jQuery instance, ScrollSpyOperation operation)
{
return null;
}
/// <summary>
/// Refreshes the ScrollSpy element. It should be done if adding or removing of elements from the DOM.
/// </summary>
/// <param name="instance">The jQuery object with a ScrollSpy</param>
/// <returns>The jQuery object</returns>
[Template("{0}.scrollspy('refresh')")]
public static jQuery ScrollSpyRefresh(this jQuery instance)
{
return null;
}
}
/// <summary>
/// ScrollSpy options
/// </summary>
[External]
[ObjectLiteral]
public class ScrollSpyOptions
{
/// <summary>
/// The string selector of the target.
/// </summary>
public virtual string Target
{
get;
set;
}
/// <summary>
/// Pixels to offset from top when calculating position of scroll.
/// Defaults to 10.
/// </summary>
public virtual int Offset
{
get;
set;
}
}
/// <summary>
/// Possible operations on a scrollspy
/// </summary>
[External]
[Enum(Emit.StringNameLowerCase)]
[Name("String")]
public enum ScrollSpyOperation
{
/// <summary>
/// Refreshes the ScrollSpy element. It should be done if adding or removing of elements from the DOM.
/// </summary>
Refresh
}
/// <summary>
/// ScrollSpy events
/// </summary>
[External]
[Enum(Emit.StringNameLowerCase)]
[Name("String")]
public enum ScrollSpyEvent
{
/// <summary>
/// This event fires whenever a new item becomes activated by the scrollspy.
/// </summary>
[Name("activate.bs.scrollspy")]
Activate
}
}