Comparing version 0.5.0 to 0.5.1
@@ -54,5 +54,5 @@ 'use strict'; | ||
var historyMethod = options.historyMethod || 'pushState'; | ||
var origChangeState = routerWindow.history[historyMethod]; | ||
this.changeState = routerWindow.history[historyMethod] = function () { | ||
this.historyMethod = options.historyMethod || 'pushState'; | ||
var origChangeState = routerWindow.history[this.historyMethod]; | ||
routerWindow.history[this.historyMethod] = function () { | ||
origChangeState.apply(routerWindow.history, arguments); | ||
@@ -130,3 +130,3 @@ navigateToHash(); | ||
if (fragment !== stripHash(this.window.location.hash)) { | ||
this.changeState(null, null, '#' + fragment); | ||
this.window.history[this.historyMethod](null, null, '#' + fragment); | ||
} | ||
@@ -133,0 +133,0 @@ } |
@@ -31,5 +31,5 @@ // just the necessary bits of Backbone router+history | ||
const historyMethod = options.historyMethod || 'pushState'; | ||
const origChangeState = routerWindow.history[historyMethod]; | ||
this.changeState = routerWindow.history[historyMethod] = function() { | ||
this.historyMethod = options.historyMethod || 'pushState'; | ||
const origChangeState = routerWindow.history[this.historyMethod]; | ||
routerWindow.history[this.historyMethod] = function() { | ||
origChangeState.apply(routerWindow.history, arguments); | ||
@@ -71,3 +71,3 @@ navigateToHash(); | ||
if (fragment !== stripHash(this.window.location.hash)) { | ||
this.changeState(null, null, `#${fragment}`); | ||
this.window.history[this.historyMethod](null, null, `#${fragment}`); | ||
} | ||
@@ -74,0 +74,0 @@ } |
{ | ||
"name": "panel", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "virtual-dom view management and routing", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
[![Build Status](https://travis-ci.org/mixpanel/panel.svg?branch=master)](https://travis-ci.org/mixpanel/panel) | ||
# panel | ||
A no-frills ES2015 microframework for virtual-dom view management and routing | ||
A no-frills ES2015 microframework for virtual-dom view management and routing. Because coding UIs shouldn't be rocket science. | ||
@@ -41,3 +41,3 @@ ```javascript | ||
Inspired by aspects of [Mercury](https://github.com/Raynos/mercury), [React](https://facebook.github.io/react/), [Redux](http://redux.js.org/), and [Cycle](http://cycle.js.org/), with an emphasis on simple pragmatism over functional purity thanks to Henrik Joreteg's ["Feather" app demo](https://github.com/HenrikJoreteg/feather-app). Strips out the opaque abstractions and data flow management layers to provide a straightforward, largely imperative, state-based rendering cycle. Gone are Mercury's channels, React's stores, Cycle's observables, to say nothing of Backbone's event soup and DOM dependencies - a Plain Old Javascript Object represents state, you update it with `App.update()`, and the DOM gets updated according to the diff. If you really need more fine-grained state management, you can plug in Redux seamlessly (hint: in most apps, you just don't need it). | ||
Inspired by aspects of [Mercury](https://github.com/Raynos/mercury), [React](https://facebook.github.io/react/), [Redux](http://redux.js.org/), and [Cycle](http://cycle.js.org/), with an emphasis on simple pragmatism over functional purity thanks to Henrik Joreteg's ["Feather" app demo](https://github.com/HenrikJoreteg/feather-app). Strips out the opaque abstractions and data flow management layers to provide a straightforward, largely imperative, state-based rendering cycle. Gone are Mercury's channels, React's stores, Cycle's observables, Backbone's event soup and DOM dependencies - a Plain Old Javascript Object represents state, you update it with `App.update()`, and the DOM gets updated according to the diff. If you really need more fine-grained state management, you can plug in Redux seamlessly (hint: in most apps, you just don't need it). | ||
@@ -49,1 +49,7 @@ Magic is kept to a minimum. Core components are [virtual-dom](https://github.com/Matt-Esch/virtual-dom) for mapping state to DOM, [main-loop](https://github.com/Raynos/main-loop) for batching updates efficiently, and [dom-delegator](https://github.com/Raynos/dom-delegator) for attaching event handlers to virtual-dom nodes. `panel` glues these together while adding some facilities for effectively nesting views, standardizing event handlers/template helpers, and providing out-of-the-box routing (based on the [Backbone Router](http://backbonejs.org/#Router)). View templates can be made with anything that produces [Hyperscript](https://github.com/Matt-Esch/virtual-dom/tree/master/virtual-hyperscript), including raw hyperscript code or Jade or JSX. Close control of component lifecycle events and DOM rendering can be achieved through use of [Web Components](http://webcomponents.org/) or [virtual-dom widgets](https://github.com/Matt-Esch/virtual-dom/blob/master/docs/widget.md). | ||
`npm install --save panel` | ||
## Running tests | ||
`npm test` | ||
With debugger: `npm run test-debug` |
32910
54