Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: actionbar improvements. modal to test out action-bar class on c…
…ustom setup. also fixed errors with demo.
- Loading branch information
1 parent
6fc79f1
commit 525200b
Showing
11 changed files
with
92 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {Observable} from 'data/observable'; | ||
|
||
export function onLoaded(args: any) { | ||
let page = args.object; | ||
page.bindingContext = new ModalDemo(); | ||
} | ||
|
||
export function onShownModally(args: any) { | ||
args.object.bindingContext.init({ | ||
title: args.context, | ||
closeCallback: args.closeCallback | ||
}); | ||
} | ||
|
||
class ModalDemo extends Observable { | ||
private _closeCallback: Function; | ||
|
||
public init(data) { | ||
this.set('title', data.title); | ||
this._closeCallback = data.closeCallback; | ||
} | ||
public close() { | ||
this._closeCallback(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Page xmlns="http://www.nativescript.org/tns.xsd" | ||
loaded="onLoaded" | ||
shownModally="onShownModally"> | ||
<StackLayout> | ||
<GridLayout rows="auto" columns="100,*,100" class="action-bar m-10"> | ||
<Button text="Close" tap="{{close}}" row="0" col="0" class="action-item text-left" /> | ||
<Label text="{{title}}" textWrap="true" col="1" class="action-title text-center" /> | ||
</GridLayout> | ||
<StackLayout class="hr-light"></StackLayout> | ||
|
||
<StackLayout class="p-20"> | ||
<Label text="Just to show that 'action-bar' class can be used to style a custom action bar like above for use in modals." class="h2" textWrap="true" /> | ||
</StackLayout> | ||
</StackLayout> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,5 @@ | |
|
||
.action-item { | ||
font-weight: normal; | ||
color:$primary; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters