Skip to content

Instantly share code, notes, and snippets.

@pixelcort
pixelcort / gist:1820866
Created February 13, 2012 22:04
relationships using DS.Store#filter
App.FirstModel = DS.Model.extend({
foreignUnsorted: function() {
return App.store.filter(App.ForeignModel, function(hash) {
return false;
});
}.property().cacheable(),
foreign: function() {
var foreignUnsorted = this.get('foreignUnsorted');
return foreignUnsorted.toArray().sort(function(a,b) {
@ppcano
ppcano / tab_view.js
Created February 3, 2012 11:13
new tab view
require('app/app');
var get = Ember.get , set = Ember.set, setPath = Ember.setPath, getPath = Ember.getPath;
// Tab View was created because a general Tab did not
// work because the flip animation
// with z-index opacity feature won't work, because it shows the hidden z-index panels
App.TabMainView = Ember.Mixin.create({
@ppcano
ppcano / Makefile
Created January 19, 2012 11:35
assetfile
update:
rm -rf packages/*; \
cp -pr ~/Git/forks/ember.js/packages/* ./packages; \
cp -pr ~/Git/forks/sproutcore-touch/packages/ember-touch ./packages; \
cp -pr ~/Git/emberjs/ember-mk/packages/ember-mk ./packages
@ppcano
ppcano / carousel_view.js
Created January 13, 2012 13:01
Ember Touch ScrollView without iScroll, and using movejs for transfomations.
@ppcano
ppcano / scroll_mixin.js
Created January 12, 2012 16:58
View get notified when its childviews has been inserted.
ScrollMixin = Em.Mixin.create({
didInsertElementEnd: function() {
this._setup_dimensions();
this._super();
}
..........
});
@ppcano
ppcano / swipe.css
Created January 7, 2012 13:57
Ember SwipeView for mobile devices based on SwipeView's approach of @cubiq
.swipe_item {
position: absolute;
-webkit-transform: translateZ(0);
top: 0px;
height: 100%;
width: 100%;
}
.swipe_slider {
position: relative;
@ppcano
ppcano / scrollable_view.js
Created November 17, 2011 17:49
ScrollableView using sproutcore-touch
UI.Kit.ScrollableView = SC.CollectionView.extend({
// options
animationDuration: 1000,
easing: "easeOutExpo",
// must be set ( pixels available) to provide elastic scroll
scrollableHeight: 0,
// options elastic
@ppcano
ppcano / ember_reopen.js
Created May 20, 2014 17:02
hammerJS + ember integration
Em.View.reopen({
hammerOptions: null,
enableHammer: function() {
var gestures = ['drag', 'hold', 'release', 'swipe', 'tap', 'touch', 'transform'];
var options = this.get('hammerOptions');
if ( options ) {
gestures.forEach(function(gesture) {
if ( !options[gesture] ) {