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
**_filename_ String** - The name of the file you want to create the path
318
-
for.<br> **Returns String**
319
+
for.<br>
320
+
**Returns String**
319
321
320
322
If you want to create a path to a file in your module folder, use the `file()`
321
323
method. It returns the path to the filename given as the attribute. Is method
322
324
comes in handy when configuring the [getScripts](#getscripts) and
323
325
[getStyles](#getstyles) methods.
324
326
325
-
### `this.updateDom(speed)`
327
+
### `this.updateDom(speed|options)`
326
328
327
329
**_speed_ Number** - Optional. Animation speed in milliseconds.<br>
328
330
@@ -343,10 +345,40 @@ start: function() {
343
345
...
344
346
```
345
347
348
+
**_options_ Object** - (_Introduced in version: 2.25.0._) Optional. Allows you to determine the animation speed and animation type options, whenever your module needs to be updated
349
+
350
+
| options | type | description |
351
+
| ------- | ---- | ----------- |
352
+
| speed | Number | animation speed in ms |
353
+
| animate | Object | animate IN and OUT rules (see below) |
354
+
355
+
356
+
**animate Object**
357
+
358
+
| animate | type | description |
359
+
| ------- | ---- | ----------- |
360
+
| in | String | Animate name when module will be shown (after dom update), it will use an `animateIn` type name (see [Animation Guide](../modules/animate#animatein)) |
361
+
| out | String | Animate name when module will be hidden (before dom update), it will use an `animateOut` type name (see [Animation Guide](../modules/animate#animateout)) |
362
+
363
+
As an example:
364
+
```javascript
365
+
...
366
+
this.updateDom( {
367
+
options: {
368
+
speed:1000, // animation duration
369
+
animate: {
370
+
in:"backInDown", // animation when module shown (after update)
371
+
out:"backOutUp"// animatation when module will hide (before update)
**_speed_ Number** - Optional (Required when setting callback or options), The
382
-
speed of the hide animation in milliseconds. **_callback_ Function** - Optional,
383
-
The callback after the hide animation is finished. **_options_ Function** -
384
-
Optional, Object with additional options for the hide action (see below).
385
-
(_Introduced in version: 2.1.0._)
414
+
speed of the hide animation in milliseconds.<br>
415
+
**_callback_ Function** - Optional, The callback after the hide animation is finished.<br>
416
+
**_options_ Function** - Optional, Object with additional options for the hide action (see below). (_Introduced in version: 2.1.0._)
386
417
387
418
To hide a module, you can call the `hide(speed, callback)` method. You can call
388
419
the hide method on the module instance itself using `this.hide()`, but of course
@@ -396,21 +427,23 @@ Possible configurable options:
396
427
modules identifier as the locksString: `this.identifier`. See _visibility
397
428
locking_ below.
398
429
399
-
**Note 1:** If the hide animation is cancelled, for instance because the show
430
+
-`animate` - String - (_Introduced in version: 2.25.0._) Hide the module with a special animate. It will use an `animateOut` type name. All animations name are available in [Animation Guide](../modules/animate.html#animateout)
431
+
432
+
::: warning Notes:
433
+
- If the hide animation is cancelled, for instance because the show
400
434
method is called before the hide animation was finished, the callback will not
401
-
be called.<br> **Note 2:** If the hide animation is hijacked (an other method
402
-
calls hide on the same module), the callback will not be called.<br> **Note 3:**
403
-
If the dom is not yet created, the hide method won't work. Wait for the
- If an `animateOut` is defined in global module configuration, `animate` string will be ignored
440
+
:::
406
441
407
442
### `this.show(speed, callback, options)`
408
443
409
-
**_speed_ Number** - Optional (Required when setting callback or options), The
410
-
speed of the show animation in milliseconds. **_callback_ Function** - Optional,
411
-
The callback after the show animation is finished. **_options_ Function** -
412
-
Optional, Object with additional options for the show action (see below).
413
-
(_Introduced in version: 2.1.0._)
444
+
**_speed_ Number** - Optional (Required when setting callback or options), The speed of the show animation in milliseconds.<br>
445
+
**_callback_ Function** - Optional, The callback after the show animation is finished.<br>
446
+
**_options_ Function** - Optional, Object with additional options for the show action (see below). (_Introduced in version: 2.1.0._)
414
447
415
448
To show a module, you can call the `show(speed, callback)` method. You can call
416
449
the show method on the module instance itself using `this.show()`, but of course
@@ -428,14 +461,18 @@ Possible configurable options:
428
461
-`onError(error)` - Function - If a module is hidden with other lock strings
429
462
and can therefore not be shown the onError callback triggers with an error
430
463
object, if specified in the options (_Introduced in version: 2.15.0_).
464
+
-`animate` - String - (_Introduced in version: 2.25.0._) Show the module with a special animation. It will use an `animateIn` type name. All animations name are available in [Animation Guide](../modules/animate.html#animatein)
431
465
432
-
**Note 1:** If the show animation is canceled, for instance because the hide
466
+
::: warning Notes:
467
+
- If the show animation is canceled, for instance because the hide
433
468
method is called before the show animation was finished, the callback will not
434
-
be called.<br> **Note 2:** If the show animation is hijacked (an other method
435
-
calls show on the same module), the callback will not be called.<br> **Note 3:**
436
-
If the dom is not yet created, the show method won't work. Wait for the
- If an `animateIn` is defined in global module configuration, `animate` string will be ignored
475
+
:::
439
476
440
477
### Visibility locking
441
478
@@ -559,7 +596,7 @@ Comments in translation files could help other translators.
559
596
560
597
#### `this.translate(identifier, variables)`
561
598
562
-
**_identifier_ String** - Identifier of the string that should be translated.
599
+
**_identifier_ String** - Identifier of the string that should be translated.<br>
563
600
**_variables_ Object** - Object of variables to be used in translation.
564
601
565
602
This improved and backwards compatible way to handle translations behaves like
@@ -574,15 +611,15 @@ var timeUntilEnd = moment(event.endDate, "x").fromNow(true);
574
611
this.translate("RUNNING", { "timeUntilEnd": timeUntilEnd) }); // Will return a translated string for the identifier RUNNING, replacing `{timeUntilEnd}` with the contents of the variable `timeUntilEnd` in the order that translator intended.
575
612
```
576
613
577
-
**Example English.json file:**
614
+
**Example English.json file:**
578
615
579
616
```javascript
580
617
{
581
618
"RUNNING":"Ends in {timeUntilEnd}",
582
619
}
583
620
```
584
621
585
-
**Example Finnish.json file:**
622
+
**Example Finnish.json file:**
586
623
587
624
```javascript
588
625
{
@@ -605,7 +642,7 @@ this.translate("RUNNING", {
605
642
)}); // Will return a translated string for the identifier RUNNING, replacing `{timeUntilEnd}` with the contents of the variable `timeUntilEnd` in the order that translator intended. (has a fallback)
606
643
```
607
644
608
-
**Example Swedish.json file that does not have the variable in it:**
645
+
**Example Swedish.json file that does not have the variable in it:**
0 commit comments