You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-14Lines changed: 29 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,39 +4,53 @@ An application for the Fitbit Ionic can quickly become a mess. This micro-framew
4
4
5
5
## Installation
6
6
7
-
Copy `view.js` file to your project.
7
+
This repository contains the starting boilerplate for the multi-screen project. You could copy all the files as they are,
8
+
or just copy the `/app/view.js` file to your project.
8
9
9
10
## API
10
11
11
12
### DOM selectors
12
13
13
-
#### `function` $( selector )
14
+
#### `function` $( query, [ element ] )
14
15
15
-
Global jQuery-style `$` selector to access SVG DOM elements returning raw elements. No wrapping is performed, the raw element or elements array is returned. Just two simple selectors are supported:
16
+
jQuery-style `$` query to access SVG DOM elements. No wrapping is performed, the raw element or elements array is returned.
17
+
If an `element` argument is provided, the element's subtree will be searched; otherwise the search will be global.
16
18
17
-
-`$( '#id-of-an-element' )` - will call `document.getElementById( 'id-of-an-element' )`
18
-
-`$( '.class-name' )` - will call `document.getElementsByClassName( 'class-name' )`
19
+
The `query` is the space-separated sequence of the following simple selectors:
19
20
20
-
When called without arguments, returns the `document`.
21
+
-`#id-of-an-element` - will call `element.getElementById( 'id-of-an-element' )` and return en element.
22
+
-`.class-name` - will call `element.getElementsByClassName( 'class-name' )` and return elements array.
23
+
-`element-type` - will call `element.getElementsByTypeName( 'element-type' )` and return elements array.
24
+
25
+
If all of the selectors in the query are `#id` selectors, the single element will be returned. Otherwise, an array of elements will be returned.
21
26
22
27
```javascript
23
28
import { $ } from'./view'
24
29
25
30
// Will search for #element globally
26
31
$( '#element' ).style.display='inline';
32
+
33
+
// Find the root element of the screen, then show all underlying elements having "hidden" class.
0 commit comments