mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore: allow you to use ionic!
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 />
|
||||
*/
|
||||
|
||||
@@ -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 {
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -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');
|
||||
|
||||
@@ -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() {}
|
||||
};
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
.button.button-android {
|
||||
border-radius: 5px;
|
||||
}
|
||||
@@ -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 })
|
||||
|
||||
|
||||
*/
|
||||
@@ -1,6 +0,0 @@
|
||||
.button.button-pop {
|
||||
box-shadow: 0 9px 0 black;
|
||||
&:active {
|
||||
transform: translate3d(0, 2px, 0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user