Skip to content

Commit

Permalink
Added support for window path template
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Apr 16, 2015
1 parent e3a7d39 commit bde8ad0
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 90 deletions.
83 changes: 43 additions & 40 deletions atoms-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -8072,46 +8072,49 @@ this.setLocalValue('src', Atom.get(this,'templateParent.url'), e);
/*Line 172 - 'AtomWindow.js' */ });
/*Line 173 - 'AtomWindow.js' */ }];

/*Line 175 - 'AtomWindow.js' */ var wt = Atom.get(c.scope, url.path);

/*Line 177 - 'AtomWindow.js' */ var $wt = $( AtomUI.cloneNode(wt));
/*Line 178 - 'AtomWindow.js' */ var ct = $wt.children("[atom-template=commandTemplate],[data-atom-template=commandTemplate]").get(0);
/*Line 179 - 'AtomWindow.js' */ if (ct) {
/*Line 180 - 'AtomWindow.js' */ AtomUI.removeAttr(ct, "atom-template");
/*Line 181 - 'AtomWindow.js' */ w._commandTemplate = ct;
/*Line 182 - 'AtomWindow.js' */ $(ct).remove();
/*Line 183 - 'AtomWindow.js' */ }

/*Line 185 - 'AtomWindow.js' */ ct = $wt.children("[atom-template=windowTemplate],[data-atom-template=windowTemplate]").get(0);
/*Line 186 - 'AtomWindow.js' */ if (ct) {
/*Line 187 - 'AtomWindow.js' */ AtomUI.removeAttr(ct, "atom-template");
/*Line 188 - 'AtomWindow.js' */ w._windowTemplate = ct;
/*Line 189 - 'AtomWindow.js' */ } else {
/*Line 190 - 'AtomWindow.js' */ AtomUI.removeAttr(wt, "atom-template");
/*Line 191 - 'AtomWindow.js' */ w._windowTemplate = wt;
/*Line 192 - 'AtomWindow.js' */ }


/*Line 195 - 'AtomWindow.js' */ w.init();

/*Line 197 - 'AtomWindow.js' */ WebAtoms.dispatcher.callLater(function () {
/*Line 198 - 'AtomWindow.js' */ var scope = w.get_scope();

/*Line 200 - 'AtomWindow.js' */ var hash = url.hash;
/*Line 201 - 'AtomWindow.js' */ for (var i in hash) {
/*Line 202 - 'AtomWindow.js' */ if (hash.hasOwnProperty(i))
/*Line 203 - 'AtomWindow.js' */ Atom.set(scope, i, hash[i]);
/*Line 204 - 'AtomWindow.js' */ }

/*Line 206 - 'AtomWindow.js' */ var query = url.query;
/*Line 207 - 'AtomWindow.js' */ for (var i in query) {
/*Line 208 - 'AtomWindow.js' */ if (query.hasOwnProperty(i))
/*Line 209 - 'AtomWindow.js' */ Atom.set(w, i, query[i]);
/*Line 210 - 'AtomWindow.js' */ }

/*Line 212 - 'AtomWindow.js' */ w.openWindow(c.scope, c.opener);
/*Line 213 - 'AtomWindow.js' */ });
/*Line 214 - 'AtomWindow.js' */};
/*Line 175 - 'AtomWindow.js' */ var wt = url.path;
/*Line 176 - 'AtomWindow.js' */ if (!AtomUI.isNode(wt)) {
/*Line 177 - 'AtomWindow.js' */ wt = Atom.get(c.scope, url.path);
/*Line 178 - 'AtomWindow.js' */ }

/*Line 180 - 'AtomWindow.js' */ var $wt = $( AtomUI.cloneNode(wt));
/*Line 181 - 'AtomWindow.js' */ var ct = $wt.children("[atom-template=commandTemplate],[data-atom-template=commandTemplate]").get(0);
/*Line 182 - 'AtomWindow.js' */ if (ct) {
/*Line 183 - 'AtomWindow.js' */ AtomUI.removeAttr(ct, "atom-template");
/*Line 184 - 'AtomWindow.js' */ w._commandTemplate = ct;
/*Line 185 - 'AtomWindow.js' */ $(ct).remove();
/*Line 186 - 'AtomWindow.js' */ }

/*Line 188 - 'AtomWindow.js' */ ct = $wt.children("[atom-template=windowTemplate],[data-atom-template=windowTemplate]").get(0);
/*Line 189 - 'AtomWindow.js' */ if (ct) {
/*Line 190 - 'AtomWindow.js' */ AtomUI.removeAttr(ct, "atom-template");
/*Line 191 - 'AtomWindow.js' */ w._windowTemplate = ct;
/*Line 192 - 'AtomWindow.js' */ } else {
/*Line 193 - 'AtomWindow.js' */ AtomUI.removeAttr(wt, "atom-template");
/*Line 194 - 'AtomWindow.js' */ w._windowTemplate = wt;
/*Line 195 - 'AtomWindow.js' */ }


/*Line 198 - 'AtomWindow.js' */ w.init();

/*Line 200 - 'AtomWindow.js' */ WebAtoms.dispatcher.callLater(function () {
/*Line 201 - 'AtomWindow.js' */ var scope = w.get_scope();

/*Line 203 - 'AtomWindow.js' */ var hash = url.hash;
/*Line 204 - 'AtomWindow.js' */ for (var i in hash) {
/*Line 205 - 'AtomWindow.js' */ if (hash.hasOwnProperty(i))
/*Line 206 - 'AtomWindow.js' */ Atom.set(scope, i, hash[i]);
/*Line 207 - 'AtomWindow.js' */ }

/*Line 209 - 'AtomWindow.js' */ var query = url.query;
/*Line 210 - 'AtomWindow.js' */ for (var i in query) {
/*Line 211 - 'AtomWindow.js' */ if (query.hasOwnProperty(i))
/*Line 212 - 'AtomWindow.js' */ Atom.set(w, i, query[i]);
/*Line 213 - 'AtomWindow.js' */ }

/*Line 215 - 'AtomWindow.js' */ w.openWindow(c.scope, c.opener);
/*Line 216 - 'AtomWindow.js' */ });
/*Line 217 - 'AtomWindow.js' */};
/*Line 0 - 'AtomCalendar.js' */

/*Line 2 - 'AtomCalendar.js' */(function (baseType) {
Expand Down
83 changes: 43 additions & 40 deletions atoms.js
Original file line number Diff line number Diff line change
Expand Up @@ -8072,46 +8072,49 @@ this.setLocalValue('src', Atom.get(this,'templateParent.url'), e);
/*Line 172 - 'AtomWindow.js' */ });
/*Line 173 - 'AtomWindow.js' */ }];

/*Line 175 - 'AtomWindow.js' */ var wt = Atom.get(c.scope, url.path);

/*Line 177 - 'AtomWindow.js' */ var $wt = $( AtomUI.cloneNode(wt));
/*Line 178 - 'AtomWindow.js' */ var ct = $wt.children("[atom-template=commandTemplate],[data-atom-template=commandTemplate]").get(0);
/*Line 179 - 'AtomWindow.js' */ if (ct) {
/*Line 180 - 'AtomWindow.js' */ AtomUI.removeAttr(ct, "atom-template");
/*Line 181 - 'AtomWindow.js' */ w._commandTemplate = ct;
/*Line 182 - 'AtomWindow.js' */ $(ct).remove();
/*Line 183 - 'AtomWindow.js' */ }

/*Line 185 - 'AtomWindow.js' */ ct = $wt.children("[atom-template=windowTemplate],[data-atom-template=windowTemplate]").get(0);
/*Line 186 - 'AtomWindow.js' */ if (ct) {
/*Line 187 - 'AtomWindow.js' */ AtomUI.removeAttr(ct, "atom-template");
/*Line 188 - 'AtomWindow.js' */ w._windowTemplate = ct;
/*Line 189 - 'AtomWindow.js' */ } else {
/*Line 190 - 'AtomWindow.js' */ AtomUI.removeAttr(wt, "atom-template");
/*Line 191 - 'AtomWindow.js' */ w._windowTemplate = wt;
/*Line 192 - 'AtomWindow.js' */ }


/*Line 195 - 'AtomWindow.js' */ w.init();

/*Line 197 - 'AtomWindow.js' */ WebAtoms.dispatcher.callLater(function () {
/*Line 198 - 'AtomWindow.js' */ var scope = w.get_scope();

/*Line 200 - 'AtomWindow.js' */ var hash = url.hash;
/*Line 201 - 'AtomWindow.js' */ for (var i in hash) {
/*Line 202 - 'AtomWindow.js' */ if (hash.hasOwnProperty(i))
/*Line 203 - 'AtomWindow.js' */ Atom.set(scope, i, hash[i]);
/*Line 204 - 'AtomWindow.js' */ }

/*Line 206 - 'AtomWindow.js' */ var query = url.query;
/*Line 207 - 'AtomWindow.js' */ for (var i in query) {
/*Line 208 - 'AtomWindow.js' */ if (query.hasOwnProperty(i))
/*Line 209 - 'AtomWindow.js' */ Atom.set(w, i, query[i]);
/*Line 210 - 'AtomWindow.js' */ }

/*Line 212 - 'AtomWindow.js' */ w.openWindow(c.scope, c.opener);
/*Line 213 - 'AtomWindow.js' */ });
/*Line 214 - 'AtomWindow.js' */};
/*Line 175 - 'AtomWindow.js' */ var wt = url.path;
/*Line 176 - 'AtomWindow.js' */ if (!AtomUI.isNode(wt)) {
/*Line 177 - 'AtomWindow.js' */ wt = Atom.get(c.scope, url.path);
/*Line 178 - 'AtomWindow.js' */ }

/*Line 180 - 'AtomWindow.js' */ var $wt = $( AtomUI.cloneNode(wt));
/*Line 181 - 'AtomWindow.js' */ var ct = $wt.children("[atom-template=commandTemplate],[data-atom-template=commandTemplate]").get(0);
/*Line 182 - 'AtomWindow.js' */ if (ct) {
/*Line 183 - 'AtomWindow.js' */ AtomUI.removeAttr(ct, "atom-template");
/*Line 184 - 'AtomWindow.js' */ w._commandTemplate = ct;
/*Line 185 - 'AtomWindow.js' */ $(ct).remove();
/*Line 186 - 'AtomWindow.js' */ }

/*Line 188 - 'AtomWindow.js' */ ct = $wt.children("[atom-template=windowTemplate],[data-atom-template=windowTemplate]").get(0);
/*Line 189 - 'AtomWindow.js' */ if (ct) {
/*Line 190 - 'AtomWindow.js' */ AtomUI.removeAttr(ct, "atom-template");
/*Line 191 - 'AtomWindow.js' */ w._windowTemplate = ct;
/*Line 192 - 'AtomWindow.js' */ } else {
/*Line 193 - 'AtomWindow.js' */ AtomUI.removeAttr(wt, "atom-template");
/*Line 194 - 'AtomWindow.js' */ w._windowTemplate = wt;
/*Line 195 - 'AtomWindow.js' */ }


/*Line 198 - 'AtomWindow.js' */ w.init();

/*Line 200 - 'AtomWindow.js' */ WebAtoms.dispatcher.callLater(function () {
/*Line 201 - 'AtomWindow.js' */ var scope = w.get_scope();

/*Line 203 - 'AtomWindow.js' */ var hash = url.hash;
/*Line 204 - 'AtomWindow.js' */ for (var i in hash) {
/*Line 205 - 'AtomWindow.js' */ if (hash.hasOwnProperty(i))
/*Line 206 - 'AtomWindow.js' */ Atom.set(scope, i, hash[i]);
/*Line 207 - 'AtomWindow.js' */ }

/*Line 209 - 'AtomWindow.js' */ var query = url.query;
/*Line 210 - 'AtomWindow.js' */ for (var i in query) {
/*Line 211 - 'AtomWindow.js' */ if (query.hasOwnProperty(i))
/*Line 212 - 'AtomWindow.js' */ Atom.set(w, i, query[i]);
/*Line 213 - 'AtomWindow.js' */ }

/*Line 215 - 'AtomWindow.js' */ w.openWindow(c.scope, c.opener);
/*Line 216 - 'AtomWindow.js' */ });
/*Line 217 - 'AtomWindow.js' */};
/*Line 0 - 'AtomCalendar.js' */

/*Line 2 - 'AtomCalendar.js' */(function (baseType) {
Expand Down
4 changes: 2 additions & 2 deletions atoms.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion atoms.min.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/concepts/next/samples/local-window-action.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
atom-next="{
{
localWindow: {
path:'label-window',
path:$scope.labelWindow,
prop:{
title:'Open Window' },
scope:{
Expand All @@ -29,7 +29,7 @@
</button>


<div atom-template-name="label-window">
<div atom-template-name="labelWindow">
This is inside the window.
<div atom-text="[ 'Opener Data: ' + $localScope.label ]"></div>

Expand Down
6 changes: 3 additions & 3 deletions docs/concepts/next/samples/window-action.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
one-time binding will not work for controls defined later
in the visual hierarchy -->
<button atom-type="AtomButton"
atom-next="{ { window: {path:'label-window', prop:{ title:'Open Window' }, scope:{ label: 'Window Label' },next: { alert: 'Done' } } } }">
atom-next="{ { window: {path: $scope.labelWindow, prop:{ title:'Open Window' }, scope:{ label: 'Window Label' },next: { alert: 'Done' } } } }">
Open Window
</button>


<div atom-template-name="label-window"
atom-template="windowTemplate">
<div atom-template-name="labelWindow"
atom-template="windowTemplate">
This is inside the window.
<div atom-text="[ 'Opener Data: ' + $scope.label ]"></div>

Expand Down
Binary file modified nuget/Atoms.js/NuGet.log
Binary file not shown.
2 changes: 1 addition & 1 deletion nuget/Atoms.js/Package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>Atoms.js</id>
<version>1.2.609</version>
<version>1.2.611</version>
<title>Atoms.js</title>
<authors>Akash Kava</authors>
<owners></owners>
Expand Down
5 changes: 4 additions & 1 deletion src/Window/AtomWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ WebAtoms.AtomWindow.openNewWindow = function (c) {
});
}];

var wt = Atom.get(c.scope, url.path);
var wt = url.path;
if (!AtomUI.isNode(wt)) {
wt = Atom.get(c.scope, url.path);
}

var $wt = $( AtomUI.cloneNode(wt));
var ct = $wt.children("[atom-template=commandTemplate],[data-atom-template=commandTemplate]").get(0);
Expand Down

0 comments on commit bde8ad0

Please sign in to comment.