chore: allow you to use ionic!

This commit is contained in:
Andrew
2015-03-17 19:25:55 -05:00
parent df34a33736
commit 9e3d601ff9
32 changed files with 214 additions and 86 deletions

View File

View File

View File

View File

View File

@@ -1,8 +1,20 @@
class Ion {
assign(...args) {
for (let obj of args) {
//...extend this
var ILLEGAL_ASSIGN_FIELDS = {};
export class Ion {
assign() {
for (var i = 1, ii = arguments.length; i < ii; i++) {
var obj = arguments[i];
if (obj) {
var keys = Object.keys(obj);
for (var j = 0, jj = keys.length; j < jj; j++) {
var key = keys[j];
if (!ILLEGAL_ASSIGN_FIELDS[key]) {
this[key] = obj[key];
}
}
}
}
}
}

View File

View File

@@ -1,4 +1,4 @@
/*
import {TabbarConfig} from '/components/tabbar/tabbar';
import {Draggable} from '/behaviors/draggable';
@@ -15,6 +15,5 @@ TabbarConfig.platform('android')
});
});
/*
<ion-tabs config-platform-android />
*/

View File

@@ -1,3 +1,14 @@
import {Component, Template} from 'angular2/angular2';
import {Ion} from '../ion';
class Tabbar extends Ion {
@Component({
selector: 'tabbar',
bind: {
title: 'view-title'
}
})
@Template({
inline: `<div>Tabbar: {{title}}</div>`
})
export class Tabbar extends Ion {
}

View File

View File

@@ -1,9 +0,0 @@
import {ButtonConfig} from './button-config';
import {AndroidButton} from './mixins/android/android-button';
import {LargeButton} from './mixins/android-button';
ButtonConfig.platform('android').mixin(AndroidButton);
ButtonConfig.media('lg').mixin(DesktopButton);
ButtonConfig.when('popBehavior').mixin(PopButton);

View File

@@ -1,22 +0,0 @@
import { Component } from 'angular';
import { ButtonGroup } from '../components/button-group';
import { androidButton} from './platforms/android/android-button';
import { blockButton } from './block-button';
@Component({
selector: 'ion-button',
bind: {
isBlockButton: 'isBlockButton'
}
})
export class Button extends IonicComponent {
/* A button checks for a parent buttonGroup */
constructor(@Parent(ButtonGroup) buttonGroup) {
this.buttonGroup = buttonGroup;
super();
}
onPress() {
}
}
export var ButtonConfig = new IonicConfig('button');

View File

View File

View File

@@ -1,14 +0,0 @@
import { ButtonConfig } from '/components/button';
ButtonConfig.platform('android')
.mixin(androidButtonMixin)
.className('button-android'); // This is the default
export default function androidButtonMixin(buttonInstance) {
Pannable(buttonInstance);
return {
onPanStart() {},
onPan() {},
onPanEnd() {}
};
}

View File

@@ -1,3 +0,0 @@
.button.button-android {
border-radius: 5px;
}

View File

@@ -1,25 +0,0 @@
import { ButtonConfig } from '/components/button';
ButtonConfig.decorator('popButton')
.mixin(popButtonMixin)
.className('button-pop');
function popButtonMixin(buttonInstance) {
return {
onRelease() {
alert('pop!');
}
};
}
/*
//instance config
<button [config]="{popButton: true}" />
<button config-pop-button />
import ButtonConfig
ButtonConfig.set({ popButton: true })
ButtonConfig.platform('lg').set({ popButton: true })
*/

View File

@@ -1,6 +0,0 @@
.button.button-pop {
box-shadow: 0 9px 0 black;
&:active {
transform: translate3d(0, 2px, 0);
}
}