Skip to content

Commit

Permalink
chore(split-panel): renames to split-pane
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Feb 28, 2017
1 parent 9582dcf commit 27fdf6a
Show file tree
Hide file tree
Showing 23 changed files with 72 additions and 72 deletions.
10 changes: 5 additions & 5 deletions src/components/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export class Menu implements RootNode {
private _init: boolean = false;
private _events: UIEventManager;
private _gestureBlocker: BlockerDelegate;
private _isPanel: boolean = false;
private _isPane: boolean = false;

/**
* @private
Expand Down Expand Up @@ -565,7 +565,7 @@ export class Menu implements RootNode {
}

_canOpen(): boolean {
return this._isEnabled && !this._isPanel;
return this._isEnabled && !this._isPane;
}

_isSideContent(): boolean {
Expand Down Expand Up @@ -603,7 +603,7 @@ export class Menu implements RootNode {
console.debug('menu, gesture unlisten', this.side);
gesture.unlisten();
}
if (this.isOpen || (this._isPanel && this._isEnabled)) {
if (this.isOpen || (this._isPane && this._isEnabled)) {
this.resize();
}
assert(!this._isAnimating, 'can not be animating');
Expand All @@ -622,8 +622,8 @@ export class Menu implements RootNode {
/**
* @private
*/
_setIsPanel(isPanel: boolean) {
this._isPanel = isPanel;
_setIsPane(isPane: boolean) {
this._isPane = isPane;
this._updateState();
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/nav/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ export class Nav extends NavControllerBase implements AfterViewInit, RootNode {
/**
* @private
*/
_setIsPanel(isPanel: boolean) {
if (isPanel) {
_setIsPane(isPane: boolean) {
if (isPane) {
this.resize();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

@import "../../themes/ionic.globals.ios";

// Split Panel
// Split Pane
// --------------------------------------------------

.split-panel-ios.split-panel-visible >.split-panel-side {
.split-pane-ios.split-pane-visible >.split-pane-side {
min-width: 270px;
max-width: 28%;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

@import "../../themes/ionic.globals.md";

// Split Panel
// Split Pane
// --------------------------------------------------

.split-panel-md.split-panel-visible >.split-panel-side {
.split-pane-md.split-pane-visible >.split-pane-side {
min-width: 270px;
max-width: 28%;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

@import "../../themes/ionic.globals";

// Split Panel
// Split Pane
// --------------------------------------------------

ion-split-panel {
ion-split-pane {
position: absolute;
top: 0;
right: 0;
Expand All @@ -18,12 +18,12 @@ ion-split-panel {
contain: strict;
}

.split-panel-side:not(ion-menu) {
.split-pane-side:not(ion-menu) {
display: none;
}

.split-panel-visible >.split-panel-side,
.split-panel-visible >.split-panel-main {
.split-pane-visible >.split-pane-side,
.split-pane-visible >.split-pane-main {
// scss-lint:disable ImportantRule
position: relative;
top: 0;
Expand All @@ -37,25 +37,25 @@ ion-split-panel {
box-shadow: none !important;
}

.split-panel-visible >.split-panel-side {
.split-pane-visible >.split-pane-side {
flex-shrink: 0;

order: -1;
}

.split-panel-visible >.split-panel-main,
.split-panel-visible >ion-nav.split-panel-side,
.split-panel-visible >ion-tabs.split-panel-side,
.split-panel-visible >ion-menu.menu-enabled {
.split-pane-visible >.split-pane-main,
.split-pane-visible >ion-nav.split-pane-side,
.split-pane-visible >ion-tabs.split-pane-side,
.split-pane-visible >ion-menu.menu-enabled {
display: block;
}

.split-panel-visible >ion-split-panel.split-panel-side,
.split-panel-visible >ion-split-panel.split-panel-main {
.split-pane-visible >ion-split-pane.split-pane-side,
.split-pane-visible >ion-split-pane.split-pane-main {
display: flex;
}

.split-panel-visible >ion-menu.menu-enabled {
.split-pane-visible >ion-menu.menu-enabled {
>.menu-inner {
// scss-lint:disable ImportantRule
right: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ const QUERY: { [key: string]: string } = {
};

/**
* @name SplitPanel
* @name SplitPane
*/
@Component({
selector: 'ion-split-panel',
selector: 'ion-split-pane',
template: '<ng-content></ng-content>',
providers: [{provide: RootNode, useExisting: forwardRef(() => SplitPanel) }]
providers: [{provide: RootNode, useExisting: forwardRef(() => SplitPane) }]
})
export class SplitPanel extends Ion implements RootNode {
export class SplitPane extends Ion implements RootNode {

_rmListener: any;
_visible: boolean = false;
Expand All @@ -41,28 +41,28 @@ export class SplitPanel extends Ion implements RootNode {
this.children.forEach(child => {
if (child !== this) {
var isSide = child._isSideContent();
this.setPanelCSSClass(child.getElementRef(), isSide);
this.setPaneCSSClass(child.getElementRef(), isSide);
if (child.enabled) {
if (isSide) {
if (this.sideContent) {
console.error('split panel: side content was already set');
console.error('split pane: side content was already set');
}
this.sideContent = child;
} else {
if (this.mainContent) {
console.error('split panel: main content was already set');
console.error('split pane: main content was already set');
}
this.mainContent = child;
}
}
child._setIsPanel(this._visible);
child._setIsPane(this._visible);
}
});
if (!this.mainContent) {
console.error('split panel: one of the elements needs the "main" attribute');
console.error('split pane: one of the elements needs the "main" attribute');
}
if (this.mainContent === this.sideContent) {
console.error('split panel: main and side content are the same');
console.error('split pane: main and side content are the same');
}
}

Expand All @@ -83,7 +83,7 @@ export class SplitPanel extends Ion implements RootNode {
return this._mediaQuery;
}

@Output() ionChange: EventEmitter<SplitPanel> = new EventEmitter<SplitPanel>();
@Output() ionChange: EventEmitter<SplitPane> = new EventEmitter<SplitPane>();

constructor(
private _zone: NgZone,
Expand All @@ -92,7 +92,7 @@ export class SplitPanel extends Ion implements RootNode {
elementRef: ElementRef,
renderer: Renderer,
) {
super(config, elementRef, renderer, 'split-panel');
super(config, elementRef, renderer, 'split-pane');
}

ngAfterViewInit() {
Expand Down Expand Up @@ -132,7 +132,7 @@ export class SplitPanel extends Ion implements RootNode {
return;
}
this._visible = visible;
this.setElementClass('split-panel-visible', visible);
this.setElementClass('split-pane-visible', visible);
this.updateChildren();

this._zone.run(() => {
Expand All @@ -148,10 +148,10 @@ export class SplitPanel extends Ion implements RootNode {
this._renderer.setElementClass(this._elementRef.nativeElement, className, add);
}

setPanelCSSClass(elementRef: ElementRef, isSide: boolean) {
setPaneCSSClass(elementRef: ElementRef, isSide: boolean) {
const ele = elementRef.nativeElement;
this._renderer.setElementClass(ele, 'split-panel-side', isSide);
this._renderer.setElementClass(ele, 'split-panel-main', !isSide);
this._renderer.setElementClass(ele, 'split-pane-side', isSide);
this._renderer.setElementClass(ele, 'split-pane-main', !isSide);
}

ngOnDestroy() {
Expand All @@ -161,7 +161,7 @@ export class SplitPanel extends Ion implements RootNode {
this._rmListener = null;
}

_setIsPanel(isPanel: boolean) {
_setIsPane(isPane: boolean) {
// Conforms to RootNode abstract class
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

@import "../../themes/ionic.globals.wp";

// Split Panel
// Split Pane
// --------------------------------------------------

.split-panel-wp.split-panel-visible >.split-panel-side {
.split-pane-wp.split-pane-visible >.split-pane-side {
min-width: 270px;
max-width: 28%;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, NgModule } from '@angular/core';
import { IonicApp, IonicModule, NavController, MenuController, SplitPanel } from '../../../../../ionic-angular';
import { IonicApp, IonicModule, NavController, MenuController, SplitPane } from '../../../../../ionic-angular';


@Component({
Expand Down Expand Up @@ -91,8 +91,8 @@ export class E2EApp {
root = E2EPage;
root2 = SidePage;

splitPanelChanged(splitPanel: SplitPanel) {
console.log('Split panel changed, visible: ', splitPanel.isVisible());
splitPaneChanged(splitPane: SplitPane) {
console.log('Split pane changed, visible: ', splitPane.isVisible());
}
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<ion-split-panel (ionChange)="splitPanelChanged($event)">
<ion-split-pane (ionChange)="splitPaneChanged($event)">
<ion-menu [content]="content">
<ion-nav [root]="root2"></ion-nav>
</ion-menu>
<ion-nav [root]="root" main #content></ion-nav>
</ion-split-panel>
</ion-split-pane>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, NgModule } from '@angular/core';
import { IonicApp, IonicModule, NavController, MenuController, SplitPanel } from '../../../../../ionic-angular';
import { IonicApp, IonicModule, NavController, MenuController, SplitPane } from '../../../../../ionic-angular';

@Component({
template: `
Expand Down Expand Up @@ -75,8 +75,8 @@ export class E2EPage {
export class E2EApp {
root = E2EPage;

splitPanelChanged(splitPanel: SplitPanel) {
console.log('Split panel changed, visible: ', splitPanel.isVisible());
splitPaneChanged(splitPane: SplitPane) {
console.log('Split pane changed, visible: ', splitPane.isVisible());
}
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<ion-split-panel (ionChange)="splitPanelChanged($event)">
<ion-split-pane (ionChange)="splitPaneChanged($event)">
<ion-menu [content]="content" id="menu1">

<ion-header>
Expand Down Expand Up @@ -49,4 +49,4 @@
</ion-menu>

<ion-nav [root]="root" main #content></ion-nav>
</ion-split-panel>
</ion-split-pane>
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ export class SidePage {

@Component({
template: `
<ion-split-panel>
<ion-split-pane>
<ion-nav [root]="root"></ion-nav>
<ion-split-panel when="lg" main >
<ion-split-pane when="lg" main >
<ion-nav [root]="root2"></ion-nav>
<ion-nav [root]="root3" main ></ion-nav>
</ion-split-panel>
</ion-split-pane>
</ion-split-panel>
</ion-split-pane>
`
})
export class E2EPage {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

<ion-split-panel when="sm">
<ion-split-pane when="sm">

<ion-menu [content]="content">
<ion-nav [root]="root2"></ion-nav>
</ion-menu>

<ion-nav [root]="root" main #content></ion-nav>

</ion-split-panel>
</ion-split-pane>
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

<ion-split-panel>
<ion-split-pane>
<ion-nav [root]="root2" #content main></ion-nav>
<ion-tabs>
<ion-tab [root]="root" tabTitle="Page1"></ion-tab>
<ion-tab [root]="root" tabTitle="Page2"></ion-tab>
</ion-tabs>
</ion-split-panel>
</ion-split-pane>
4 changes: 2 additions & 2 deletions src/components/tabs/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@ export class Tabs extends Ion implements AfterViewInit, RootNode {
tab && tab.resize();
}

_setIsPanel(isPanel: boolean): void {
if (isPanel) {
_setIsPane(isPane: boolean): void {
if (isPane) {
this.resize();
}
}
Expand Down
Loading

0 comments on commit 27fdf6a

Please sign in to comment.