-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathy-list.js
1 lines (1 loc) · 1.84 KB
/
y-list.js
1
!function t(e,r,n){function o(s,u){if(!r[s]){if(!e[s]){var p="function"==typeof require&&require;if(!u&&p)return p(s,!0);if(i)return i(s,!0);throw new Error("Cannot find module '"+s+"'")}var l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return o(r?r:t)},l,l.exports,t,e,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(t,e){var r;if(r=function(){function t(t){if(null==t)this._list=[];else{if(t.constructor!==Array)throw new Error("Y.List expects an Array as a parameter");this._list=t}}return t.prototype._name="List",t.prototype._getModel=function(t,e){return null==this._model&&(this._model=new e.ListManager(this).execute(),this._model.insert(0,this._list)),delete this._list,this._model},t.prototype._setModel=function(t){return this._model=t,delete this._list},t.prototype.val=function(){return this._model.val.apply(this._model,arguments)},t.prototype.ref=function(){return this._model.ref.apply(this._model,arguments)},t.prototype.observe=function(){return this._model.observe.apply(this._model,arguments),this},t.prototype.unobserve=function(){return this._model.unobserve.apply(this._model,arguments),this},t.prototype.insert=function(t,e){if("number"!=typeof t)throw new Error("Y.List.insert expects a Number as the first parameter!");return this._model.insert(t,[e]),this},t.prototype.insertContents=function(t,e){if("number"!=typeof t)throw new Error("Y.List.insert expects a Number as the first parameter!");return this._model.insert(t,e),this},t.prototype["delete"]=function(t,e){return this._model["delete"](t,e),this},t.prototype.push=function(t){return this._model.push(t),this},t}(),"undefined"!=typeof window&&null!==window){if(null==window.Y)throw new Error("You must first import Y!");window.Y.List=r}"undefined"!=typeof e&&null!==e&&(e.exports=r)},{}]},{},[1]);