A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/vuematerial/vue-material/commit/33007b4 below:

keep alive if its persistent (#1561) · vuematerial/vue-material@33007b4 · GitHub

File tree Expand file treeCollapse file tree 3 files changed

+11

-3

lines changed

Filter options

Expand file treeCollapse file tree 3 files changed

+11

-3

lines changed Original file line number Diff line number Diff line change

@@ -45,6 +45,12 @@

45 45

description: 'Sets the duration in milliseconds before close the snackbar.',

46 46

defaults: '4000'

47 47

},

48 +

{

49 +

name: 'md-persistent',

50 +

type: 'Boolean',

51 +

description: 'This will make the snackbar persistent in your application, even changing routes.',

52 +

defaults: 'false'

53 +

},

48 54

{

49 55

name: 'md-position',

50 56

type: 'String',

Original file line number Diff line number Diff line change

@@ -50,7 +50,7 @@

50 50

watch: {

51 51

mdActive (isActive) {

52 52

if (isActive) {

53 -

createSnackbar(this.mdDuration, this).then(() => {

53 +

createSnackbar(this.mdDuration, this.mdPersistent, this).then(() => {

54 54

this.$emit('update:mdActive', false)

55 55

this.$emit('md-opened')

56 56

})

Original file line number Diff line number Diff line change

@@ -1,7 +1,7 @@

1 1

let currentSnackbar = null

2 2

let timeout = null

3 3 4 -

function createPromise (duration, context) {

4 +

function createPromise (duration, persistent, context) {

5 5

return new Promise(resolve => {

6 6

currentSnackbar = {

7 7

destroy: () => {

@@ -13,7 +13,9 @@ function createPromise (duration, context) {

13 13

if (duration !== Infinity) {

14 14

timeout = window.setTimeout(() => {

15 15

destroySnackbar()

16 -

context._vnode.componentInstance.initDestroy(true)

16 +

if (!persistent) {

17 +

context._vnode.componentInstance.initDestroy(true)

18 +

}

17 19

}, duration)

18 20

}

19 21

})

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4