Skip to main content

Posts

Showing posts from February, 2012

Javascript Single Page

1. Model /**   * The Model. Model stores items and notifies   * observers about changes.   */ var ListModel = function (items) {      this ._items = items;      this ._selectedIndex = -1;        this .itemAdded = new Event( this );      this .itemRemoved = new Event( this );      this .selectedIndexChanged = new Event( this ); };   ListModel.prototype = {        getItems : function () {          return [].concat( this ._items);      },        addItem : function (item) {          this ._items.push(item);          this .itemAdded.notify({item: item});      },        removeI...