1.0.5 • Published 8 years ago

vigour-modal v1.0.5

Weekly downloads
2
License
GPL
Repository
github
Last release
8 years ago

#modal js-standard-style npm version Build Status

Easily create modals for use with vigour-element

##how to use npm i --save vigour-modal

##setup

// define some data
var Observable = require('vigour-observable')
var Data = new Observable({
  inject: require('vigour-observable/lib/data'),
  Child: 'Constructor'
}).Constructor

// define some modals
var modalData = new Data({
  firstModal: {
    title:'one modal',
    buttons: {
      goToOtherModal: ['$', 'modals', 'secondModal'] // reference to secondModal field
    }
  },
  secondModal: {
    title:'another modal',
    buttons: {
      goToOtherModal: ['$', 'modals', 'firstModal'] // reference to firstModal field
    }
  }
})

// define your navigation data
var navigation = new Data({
  state:{
    modal:{
      // this is the field your modals will set when navigating
      current: modalData.firstModal
    }
  }
})

// add modal component to your app
var app = e({
  components: {
    modal: require('vigour-modal')
  },
  DOM: document.body
})

// add your modal switcher
app.set({
  myModalSwitcher: {
    type:'modal'
  }
})

// add your data
app.val = navigation
1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago