Skip to content

Commit

Permalink
Fixes rlamana#3. Maximized windows emits a reference to the restore f…
Browse files Browse the repository at this point in the history
…unction
  • Loading branch information
rlamana committed May 14, 2013
1 parent 1445806 commit 42523a6
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion build/ventus.css

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions build/ventus.js
Original file line number Diff line number Diff line change
Expand Up @@ -949,14 +949,12 @@ function(Emitter, View, WindowTemplate) {

set maximized(value) {
if(value) {
this.stamp();
this.signals.emit('maximize', this);
this._restoreMaximized = this.stamp();
this.signals.emit('maximize', this, this._restoreMaximized);
}
else {
this.signals.emit('restore', this);

this.signals.emit('restore', this, this._restoreMaximized);
}

this._maximized = value;
},

Expand Down Expand Up @@ -1180,6 +1178,8 @@ function(Emitter, View, WindowTemplate) {
return this;
};
}).apply(this);

return this.restore;
},

restore: function(){},
Expand Down Expand Up @@ -1266,8 +1266,8 @@ define('ventus/wm/modes/default',['less!../../../css/windowmanager'], function()
win.resize(this.el.width(), this.el.height());
},

restore: function(win) {
win.restore();
restore: function(win, restore) {
restore.call(win);
},

minimize: function(win) {
Expand Down Expand Up @@ -1315,7 +1315,7 @@ define('ventus/wm/modes/expose',['Underscore', 'less!../../../css/expose'], func
}, 1000));
},

// Lauch when plugin is enabled
// Launch when plugin is enabled
plug: function() {
var floor = Math.floor, ceil = Math.ceil, self = this;

Expand Down
2 changes: 1 addition & 1 deletion build/ventus.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/desktop/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Ventus: HTML5, CSS3 & Javascript Window Manager Experiment</title>
<title>Window Manager Experiment</title>
<meta name="viewport" content="width=1224">

<link href='css/normalize.css' rel='stylesheet' type='text/css' />
Expand Down Expand Up @@ -85,7 +85,7 @@ <h2>This experiment works in <strong>webkit</strong> based browsers only!</h2>

<!-- About App -->
<div class="about-app">
<h1>Ventus</h1>
<h1>Desktop</h1>
<h2>HTML5 & CSS3 Window Manager Experiment</h2>

<button class="expose-button">Try Exposé</button>
Expand All @@ -107,7 +107,7 @@ <h2>HTML5 & CSS3 Window Manager Experiment</h2>
<section>
<div class="content">
<header>
<h1>Ventus</h1>
<h1>Desktop</h1>
</header>
<p><img src="img/loader.gif" /> Loading...</p>
</div>
Expand Down
24 changes: 12 additions & 12 deletions src/ventus/css/prefix.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Prefix.less
// Prefix.less
// Copyright (c) 2012 Ramón Lamana
//
// MIT Licensed:
Expand All @@ -17,7 +17,7 @@

.user-select(@value) {
user-select: @value;

-webkit-user-select: @value;
-moz-user-select: @value;
-ms-user-select: @value;
Expand All @@ -40,7 +40,7 @@
@args: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`;
-webkit-transition: @args;
-moz-transition: @args;
-ms-transition: @args;
-ms-transition: @args;
-o-transition: @args;
transition: @args;
}
Expand All @@ -49,7 +49,7 @@
@args: ~`'@{arguments}'.replace(/\[|\]/g, '')`;
-webkit-transition-property: @args;
-moz-transition-property: @args;
-ms-transition-property: @args;
-ms-transition-property: @args;
-o-transition-property: @args;
transition-property: @args;
}
Expand All @@ -59,10 +59,10 @@

.transform(@val1, @val2:X, ...) {
@args: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`;
-webkit-transform: @args;
-moz-transform: @args;
-ms-transform: @args;
-o-transform: @args;
-webkit-transform: @args;
-moz-transform: @args;
-ms-transform: @args;
-o-transform: @args;
transform: @args;
}

Expand Down Expand Up @@ -95,10 +95,10 @@
// Gradients

.linear-gradient(@value) {
-webkit-linear-gradient: @value;
-moz-linear-gradient: @value;
-ms-linear-gradient: @value;
-o-linear-gradient: @value;
-webkit-linear-gradient: @value;
-moz-linear-gradient: @value;
-ms-linear-gradient: @value;
-o-linear-gradient: @value;
linear-gradient: @value;
}

Expand Down
14 changes: 7 additions & 7 deletions src/ventus/css/window.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
50% {.transform(rotate(-4deg));}
100% {.transform(rotate(4deg));}
}

@-moz-keyframes wobbly {
0% {.transform(rotate(4deg));}
50% {.transform(rotate(-4deg));}
Expand Down Expand Up @@ -87,8 +87,8 @@
min-width: 200px;
min-height: @minheight;

.box-shadow(0 0 12px 1px rgba(0, 0, 0, 0.6));
background-color: #fff;
//.box-shadow(0 0 12px 1px rgba(0, 0, 0, 0.6));

.wm-window-overlay {
display: none;
Expand All @@ -101,7 +101,7 @@
height: 100%;
min-height: @minheight;
width: 100%;

header.wm-window-title {
.display(flex);
.flex-flow(row);
Expand All @@ -116,7 +116,7 @@
background-color: @bgactive;

border: 0;

overflow: hidden;

h1 {
Expand Down Expand Up @@ -168,7 +168,7 @@
opacity: 1;
//-webkit-filter: ~'hue-rotate(188deg) saturate(1000%) brightness(-30%)';
}

button.wm-close {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAABi8KSDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QkIxOUQwNTEzMDM0MTFFMkI5MUFGMzlFMTgwOEI4ODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QkIxOUQwNTIzMDM0MTFFMkI5MUFGMzlFMTgwOEI4ODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpCQjE5RDA0RjMwMzQxMUUyQjkxQUYzOUUxODA4Qjg4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpCQjE5RDA1MDMwMzQxMUUyQjkxQUYzOUUxODA4Qjg4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PpFaWsQAAABxSURBVHjajJDRDcAgCERtJ2AER+oIjuZIHcER3IBCvDYX5KMklwg8lPNQ1fI3TjpfJgl9QX2F32yquuI2CWqCXNH/YFejgUpgexmGeUAjmMH+9AA4aKUN5h174qFkYEs8CMNuaMYdkc/sNySAW/0RYABjHiW8yydeWwAAAABJRU5ErkJggg==) no-repeat 1px 1px;
}
Expand Down Expand Up @@ -263,7 +263,7 @@
color: #bbb;
}
}

}

.wm-window.active {
Expand All @@ -284,7 +284,7 @@
display: none;
}
}

section.wm-content {
overflow-y: hidden;
}
Expand Down
4 changes: 2 additions & 2 deletions src/ventus/wm/modes/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ define(['less!../../../css/windowmanager'], function() {
win.resize(this.el.width(), this.el.height());
},

restore: function(win) {
win.restore();
restore: function(win, restore) {
restore.call(win);
},

minimize: function(win) {
Expand Down
2 changes: 1 addition & 1 deletion src/ventus/wm/modes/expose.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ define(['Underscore', 'less!../../../css/expose'], function(_) {
}, 1000));
},

// Lauch when plugin is enabled
// Launch when plugin is enabled
plug: function() {
var floor = Math.floor, ceil = Math.ceil, self = this;

Expand Down
10 changes: 5 additions & 5 deletions src/ventus/wm/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,12 @@ function(Emitter, View, WindowTemplate) {

set maximized(value) {
if(value) {
this.stamp();
this.signals.emit('maximize', this);
this._restoreMaximized = this.stamp();
this.signals.emit('maximize', this, this._restoreMaximized);
}
else {
this.signals.emit('restore', this);

this.signals.emit('restore', this, this._restoreMaximized);
}

this._maximized = value;
},

Expand Down Expand Up @@ -446,6 +444,8 @@ function(Emitter, View, WindowTemplate) {
return this;
};
}).apply(this);

return this.restore;
},

restore: function(){},
Expand Down

0 comments on commit 42523a6

Please sign in to comment.