Skip to content

Instantly share code, notes, and snippets.

@gist-master
Forked from adriatic/app.html
Last active April 5, 2017 13:16
Show Gist options
  • Save gist-master/86fcbc2d847ce483f249b55cfa0defa6 to your computer and use it in GitHub Desktop.
Save gist-master/86fcbc2d847ce483f249b55cfa0defa6 to your computer and use it in GitHub Desktop.
Window: basic usage
<template>
<require from="./basic-use.css"></require>
<require from="aurelia-kendoui-bridge/window/window"></require>
<require from="aurelia-kendoui-bridge/button/button"></require>
<div id="example">
<div id="window"
ak-window="k-width: 600px; k-title: About Alvar Aalto; k-visible.bind: false; k-actions.bind: actions; k-widget.bind: window"
k-on-close.delegate="onClose()">
<div class="armchair">
<img src="http://demos.telerik.com/kendo-ui/content/web/window/armchair-402.png" alt="Artek Alvar Aalto - Armchair 402" /> Artek Alvar Aalto - Armchair 402</div>
<p>Alvar Aalto is one of the greatest names in modern architecture and design. Glassblowers at the iittala factory still meticulously handcraft the legendary vases that are variations on one theme, fluid organic shapes that let the end user decide the use. Interpretations of the shape in new colors and materials add to the growing Alvar Aalto Collection that remains true to his original design.</p>
<p>Born Hugo Alvar Henrik Aalto (February 3, 1898 - May 11, 1976) in Kuortane, Finland, was noted for his humanistic approach to modernism. He studied architecture at the Helsinki University of Technology from 1916 to 1921. In 1924 he married architect Aino Marsio.</p>
<p>Alvar Aalto was one of the first and most influential architects of the Scandinavian modern movement, and a member of the Congres Internationaux d'Architecture Moderne. Major architectural works include the Finlandia Hall in Helsinki, Finland, and the campus of Helsinki University of Technology.</p>
<p>Source: <a href="http://www.aalto.com/about-alvar-aalto.html" title="About Alvar Aalto">www.aalto.com</a></p>
</div>
<span id="undo" ref="undo" style="display:none" ak-button click.delegate="open()">Click here to open the window.</span>
<div class="responsive-message"></div>
</div>
</template>
import {TaskQueue, inject} from 'aurelia-framework';
@inject(TaskQueue)
export class BasicUse {
actions = ['Pin', 'Minimize', 'Maximize', 'Close'];
constructor(taskQueue) {
this.taskQueue = taskQueue;
}
attached() {
this.taskQueue.queueTask(() => {
this.window.center().open();
});
}
open() {
this.window.open();
$(this.undo).fadeOut();
}
onClose() {
$(this.undo).fadeIn();
}
}
#example
{
min-height:500px;
}
#undo {
text-align: center;
position: absolute;
white-space: nowrap;
padding: 1em;
cursor: pointer;
}
.armchair {
float: left;
margin: 30px 30px 120px 30px;
text-align: center;
}
.armchair img {
display: block;
margin-bottom: 10px;
}
@media screen and (max-width: 1023px) {
#window-basic-use div.ak-window {
display: none !important;
}
}
<!doctype html>
<html>
<head>
<title>Aurelia KendoUI bridge</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.common.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.rtl.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.default.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.mobile.all.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.4.0/bluebird.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chroma-js/1.2.1/chroma.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/jszip.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/kendo.all.min.js"></script>
</head>
<body aurelia-app="main">
<h1>Loading...</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.6/system.js"></script>
<script src="https://rawgit.com/aurelia-ui-toolkits/aurelia-kendoui-bundles/1.0.0-beta.1.0.6/config2.js"></script>
<script>
System.import('aurelia-bootstrapper');
</script>
</body>
</html>
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('aurelia-kendoui-bridge');
aurelia.start().then(a => a.setRoot());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment