Skip to content

Instantly share code, notes, and snippets.

@armikhael
Created February 24, 2015 01:57
Show Gist options
  • Save armikhael/eadb832eb33a5fd9e489 to your computer and use it in GitHub Desktop.
Save armikhael/eadb832eb33a5fd9e489 to your computer and use it in GitHub Desktop.
CHDlp
<html ng-app="test">
<head>
<meta charset="utf-8">
<title>Popups</title>
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link href="http://code.ionicframework.com/0.9.27/css/ionic.min.css" rel="stylesheet">
<script src="http://code.ionicframework.com/0.9.27/js/ionic.bundle.js"></script>
</head>
<body ng-controller="mainCtrl">
<ion-nav-view>
</ion-nav-view>
<script id="wyszukiwarka.html" type="text/ng-template">
<div class="modal padding" ng-controller="wyszukiwarkaCtrl">
<header class="bar bar-header bar-positive">
<h1 class="title">Wyszukiwarka</h1>
<button class="button button-clear icon ion-chevron-down" ng-click="zamknijWyszukiwarke()"></button>
</header>
<ion-content has-header="true">
<div class="list list-inset">
<label class="item item-input">
<i class="icon ion-search placeholder-icon"></i>
<input type="text" placeholder="Wpisz nazwę atrakcji" name="fraza" id="fraza" ng-model="formSzukaj.fraza" ng-change="wyszukaj();">
<i class="icon ion-loading-c" ng-class="{niewidoczny: formSzukaj.szukam != 1}"></i>
</label>
</div>
</ion-content>
</div>
</script>
<script id="main.html" type="text/ng-template">
<ion-side-menus>
<!-- Center content -->
<ion-pane ion-side-menu-content drag-content="false">
<ion-nav-bar animation="nav-title-slide-ios7"
type="bar-stable"
back-button-type="button-icon"
back-button-icon="ion-arrow-left-c"></ion-nav-bar>
<ion-nav-view name="mainView" animation="slide-left-right">
</ion-nav-view>
</ion-pane>
<!-- Right menu -->
<ion-side-menu side="right">
<header class="bar bar-header bar-positive">
<h1 class="title">Menu</h1>
</header>
<ion-content has-header="true" scroll="false">
<div class="list">
<a class="item item-icon-left" href="#" ng-click="menuIndex()">
<i class="icon ion-home"></i>
Strona główna
</a>
<a class="item item-icon-left" href="#">
<i class="icon ion-gear-b"></i>
Ustawienia
</a>
<a class="item item-icon-left" href="#" onclick="ionic.Platform.exitApp();">
<i class="icon ion-close-round"></i>
Zamknij
</a>
</div>
</ion-content>
</ion-side-menu>
</ion-side-menus>
</script>
<script id="index.html" type="text/ng-template">
<ion-view title="Polskie Szlaki" right-buttons="rightButtons">
<ion-content has-header="true" padding="false" scroll="true">
sdf
</ion-content>
</ion-view>
</script>
</body>
</html>
var AppCtrl = angular.module('test', ['ionic']);
AppCtrl.config(function($stateProvider, $urlRouterProvider, $compileProvider) {
$stateProvider
// setup an abstract state for the tabs directive
.state('ps', {
url: "/ps",
abstract: true,
templateUrl: "main.html"
})
.state('ps.index', {
url: '/index',
views: {
"mainView": {
templateUrl: 'index.html',
controller: 'indexCtrl'
}
}
});
// if none of the above states are matched, use this as the fallback
$urlRouterProvider.otherwise('/ps/index');
});
AppCtrl.controller('mainCtrl', function($scope, $ionicModal, $ionicSideMenuDelegate, $timeout) {
$ionicModal.fromTemplateUrl('wyszukiwarka.html', function(modal) {
$scope.modalWyszukiwarka = modal;
}, {
// Use our scope for the scope of the modal to keep it simple
scope: $scope,
animation: 'slide-in-up'
});
$scope.rightButtons = [{
type: 'button-icon ion-android-search',
tap: function(e) {
//$state.go("ps.wyszukiwarka");
$scope.modalWyszukiwarka.show();
$timeout(function() {
var iF = document.getElementById("fraza");
iF.focus();
}, 500);
}
}, {
type: 'button-icon ion-navicon-round',
tap: function(e) {
$ionicSideMenuDelegate.toggleRight($scope.$$childHead);
}
}];
});
AppCtrl.controller('indexCtrl', function($scope) {
});
AppCtrl.controller('wyszukiwarkaCtrl', function($scope) {
$scope.zamknijWyszukiwarke = function() {
var iF = document.getElementById("fraza");
iF.blur();
$scope.modalWyszukiwarka.hide();
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment