Where the heart is
diff --git a/ionic/components/checkbox/test/basic/main.html b/ionic/components/checkbox/test/basic/main.html
index 570ee0c08e..a2a16cb0d8 100644
--- a/ionic/components/checkbox/test/basic/main.html
+++ b/ionic/components/checkbox/test/basic/main.html
@@ -36,7 +36,7 @@
-
+
diff --git a/ionic/components/icon/icon.scss b/ionic/components/icon/icon.scss
index 516dcf5ff2..10d156c411 100644
--- a/ionic/components/icon/icon.scss
+++ b/ionic/components/icon/icon.scss
@@ -4,11 +4,11 @@
// --------------------------------------------------
-icon {
+ion-icon {
display: inline-block;
font-size: 1.2em;
}
-icon[small] {
+ion-icon[small] {
font-size: 1.1em;
}
diff --git a/ionic/components/icon/icon.ts b/ionic/components/icon/icon.ts
index 04ea84e87a..b71586fe14 100644
--- a/ionic/components/icon/icon.ts
+++ b/ionic/components/icon/icon.ts
@@ -6,18 +6,20 @@ import {Config} from '../../config/config';
/**
* @name Icon
* @description
- * Icons can be used on their own, or inside of a number of Ionic components. For a full list of available icons,
- * check out the [Ionicons resource docs](../../../../resources/ionicons).
+ * Icons can be used on their own, or inside of a number of Ionic components.
+ * For a full list of available icons, check out the
+ * [Ionicons resource docs](../../../../resources/ionicons).
*
* @usage
* ```html
- *
- *
+ *
+ *
*
*
- *
+ *
* ```
*
+ * @property {string} [name] - Use the appropriate icon for the mode.
* @property {boolean} [isActive] - Whether or not the icon is active. Icons that are not active will use an outlined version of the icon.
* If there is not an outlined version for the particular icon, it will use the default (full) version.
* @property {string} [ios] - Explicitly set the icon to use on iOS.
@@ -26,7 +28,7 @@ import {Config} from '../../config/config';
*
*/
@Directive({
- selector: 'icon',
+ selector: 'ion-icon,icon',
inputs: [
'name',
'ios',
@@ -40,42 +42,29 @@ import {Config} from '../../config/config';
export class Icon {
constructor(
- private _elementRef: ElementRef,
config: Config,
+ private _elementRef: ElementRef,
private _renderer: Renderer
) {
- this.config = config;
this.mode = config.get('iconMode');
- }
- /**
- * @private
- */
- addClass(className) {
- this._renderer.setElementClass(this._elementRef, className, true);
+ if (_elementRef.nativeElement.tagName === 'ICON') {
+ // deprecated warning
+ console.warn(' has been renamed to ');
+ console.warn(' requires the "name" attribute w/ a value');
+ console.warn(' should now be ');
+ }
}
/**
* @private
*/
ngOnInit() {
- let ele = this._elementRef.nativeElement;
-
if (this.mode == 'ios' && this.ios) {
this.name = this.ios;
} else if (this.mode == 'md' && this.md) {
this.name = this.md;
-
- } else if (!this.name) {
- // looping through native dom attributes, eww
- // https://github.com/angular/angular/issues/1818
- for (let i = 0, l = ele.attributes.length; i < l; i++) {
- if (ele.attributes[i].value === '' && /_|item-|isActive|large|small|class/.test(ele.attributes[i].name) !== true) {
- this.name = ele.attributes[i].name;
- break;
- }
- }
}
if (!this.name) return;
@@ -89,6 +78,13 @@ export class Icon {
this.update();
}
+ /**
+ * @private
+ */
+ addClass(className) {
+ this._renderer.setElementClass(this._elementRef, className, true);
+ }
+
get isActive() {
return (this._isActive === undefined || this._isActive === true || this._isActive === 'true');
}
diff --git a/ionic/components/icon/test/basic/main.html b/ionic/components/icon/test/basic/main.html
index 370c8cf947..e21ec144d0 100644
--- a/ionic/components/icon/test/basic/main.html
+++ b/ionic/components/icon/test/basic/main.html
@@ -8,72 +8,51 @@
-
+
- <icon home></icon>
+ <ion-icon name="home"></ion-icon>
-
+
- <icon home isActive="true"></icon>
+ <ion-icon [name]="homeIcon"></ion-icon>
-
+
- <icon home isActive="false"></icon>
+ <ion-icon name="ion-social-twitter"></ion-icon>
-
+
- <icon name="home"></icon>
+ <ion-icon ios="ion-social-apple" md="ion-social-android"></ion-icon>
-
+
- <icon [name]="homeIcon"></icon>
+ <ion-icon [isActive]="isActive" ios="ion-social-apple" md="ion-social-android"></ion-icon>
-
+
- <icon ion-social-twitter></icon>
+ <ion-icon ios="ion-social-apple"></ion-icon>
-
+
- <icon ios="ion-social-apple" md="ion-social-android"></icon>
-
-
-
-
-
-
- <icon [isActive]="isActive" ios="ion-social-apple" md="ion-social-android"></icon>
-
-
-
-
-
-
- <icon ios="ion-social-apple"></icon>
-
-
-
-
-
-
- <icon md="ion-social-android"></icon>
+ <ion-icon md="ion-social-android"></ion-icon>
diff --git a/ionic/components/item/item-media.scss b/ionic/components/item/item-media.scss
index ab77a2100d..c8752c82b3 100644
--- a/ionic/components/item/item-media.scss
+++ b/ionic/components/item/item-media.scss
@@ -4,19 +4,19 @@
// --------------------------------------------------
// Icons, avatars, thumbnails, notes, etc.
-.item > icon[small]:first-child,
-.item-inner > icon[small]:first-child {
+.item > ion-icon[small]:first-child,
+.item-inner > ion-icon[small]:first-child {
min-width: 18px;
}
-.item > icon:first-child,
-.item-inner > icon:first-child {
+.item > ion-icon:first-child,
+.item-inner > ion-icon:first-child {
min-width: 24px;
text-align: center;
}
-.item > icon,
-.item-inner > icon {
+.item > ion-icon,
+.item-inner > ion-icon {
line-height: 1;
font-size: 2.4rem;
min-height: 2.4rem;
@@ -28,7 +28,7 @@
&[small] {
font-size: 1.8rem;
- min-height: 1.8rem;
+ min-height: 1.8rem;
}
}
diff --git a/ionic/components/item/item.ios.scss b/ionic/components/item/item.ios.scss
index 0236f52253..a40f1459c7 100644
--- a/ionic/components/item/item.ios.scss
+++ b/ionic/components/item/item.ios.scss
@@ -121,7 +121,7 @@ ion-thumbnail[item-right] {
min-height: 25px;
}
-.button-icon-only icon,
+.button-icon-only ion-icon,
.button-icon-only {
padding: 0 1px;
}
diff --git a/ionic/components/item/item.md.scss b/ionic/components/item/item.md.scss
index f546fb5f63..39edbda284 100644
--- a/ionic/components/item/item.md.scss
+++ b/ionic/components/item/item.md.scss
@@ -89,8 +89,8 @@ ion-item-content {
margin: $item-md-padding-media-top ($item-md-padding-right / 2) $item-md-padding-media-bottom 0;
}
-icon[item-left],
-icon[item-right] {
+ion-icon[item-left],
+ion-icon[item-right] {
margin-top: $item-md-padding-icon-top;
margin-bottom: $item-md-padding-icon-bottom;
margin-left: 0;
@@ -102,7 +102,7 @@ icon[item-right] {
font-size: 1.2rem;
}
-.button-icon-only icon,
+.button-icon-only ion-icon,
.button-icon-only {
padding: 0 1px;
}
@@ -112,8 +112,8 @@ icon[item-right] {
line-height: $item-md-body-text-line-height;
}
-icon[item-left] + .item-inner,
-icon[item-left] + .item-input {
+ion-icon[item-left] + .item-inner,
+ion-icon[item-left] + .item-input {
margin-left: $item-md-padding-left + ($item-md-padding-left / 2);
}
diff --git a/ionic/components/item/test/buttons/main.html b/ionic/components/item/test/buttons/main.html
index 4243ccc996..4a54f239ea 100644
--- a/ionic/components/item/test/buttons/main.html
+++ b/ionic/components/item/test/buttons/main.html
@@ -26,12 +26,12 @@
left icon buttons
@@ -39,36 +39,36 @@
right icon buttons
icon only buttons
ion-item right icon/text button
ion-item left clear button
diff --git a/ionic/components/item/test/icons/main.html b/ionic/components/item/test/icons/main.html
index facaaf4b36..7eec48af15 100644
--- a/ionic/components/item/test/icons/main.html
+++ b/ionic/components/item/test/icons/main.html
@@ -1,4 +1,6 @@
-Item Icons
+
+ Item Icons
+
@@ -16,44 +18,44 @@
a[ion-item] w/ right side default icon
-
+
a[ion-item] w/ right side large icon
-
+
a[ion-item] w/ right side small icon
-
+
-
+
ion-item w/ both side icons
-
+
a[ion-item] w/ two right side icons
-
-
+
+
diff --git a/ionic/components/item/test/images/main.html b/ionic/components/item/test/images/main.html
index 53fa230b4b..c520540a90 100644
--- a/ionic/components/item/test/images/main.html
+++ b/ionic/components/item/test/images/main.html
@@ -7,12 +7,12 @@
-
+
One Line w/ Icon, div only text
-
+
Two Lines w/ Icon, H2 Header
Paragraph text.
diff --git a/ionic/components/item/test/media/main.html b/ionic/components/item/test/media/main.html
index 9ff54689b5..1ed195fa61 100644
--- a/ionic/components/item/test/media/main.html
+++ b/ionic/components/item/test/media/main.html
@@ -56,7 +56,7 @@
Icon on right
Vertically align top
button.item
-
+
diff --git a/ionic/components/item/test/sliding/main.html b/ionic/components/item/test/sliding/main.html
index 5b002df90b..9240f6b270 100644
--- a/ionic/components/item/test/sliding/main.html
+++ b/ionic/components/item/test/sliding/main.html
@@ -31,7 +31,7 @@