Skip to content

Commit

Permalink
Merge pull request #79 from andreybutenko/maximize
Browse files Browse the repository at this point in the history
Maximized window behavior
  • Loading branch information
rlamana authored Jun 19, 2018
2 parents b45aff4 + 68f1a4c commit 5d3be8b
Show file tree
Hide file tree
Showing 6 changed files with 5,612 additions and 33 deletions.
61 changes: 33 additions & 28 deletions dist/ventus.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/*!
* Ventus 0.3
* Copyright © 2015 Ramón Lamana
* http://www.rlamana.com
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) { // AMD.
define(['$'], factory);
} else { // Browser globals
root.Ventus = factory(root.$);
}
}(this, function (jQuery) {

/*!
* Ventus 0.3
* Copyright © 2015 Ramón Lamana
* http://www.rlamana.com
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) { // AMD.
define(['$'], factory);
} else { // Browser globals
root.Ventus = factory(root.$);
}
}(this, function (jQuery) {

var requirejs, require, define;
(function (undef) {
var defined = {}, waiting = {}, config = {}, defining = {}, aps = [].slice, main, req;
Expand Down Expand Up @@ -1230,7 +1230,9 @@ define('ventus/wm/window', [
}
},
'.wm-window-title mousedown': function (e) {
this.slots.move.call(this, e);
if (!this.maximized) {
this.slots.move.call(this, e);
}
},
'.wm-window-title dblclick': function () {
if (this.enabled && this.resizable) {
Expand Down Expand Up @@ -1337,8 +1339,10 @@ define('ventus/wm/window', [
set maximized(value) {
if (value) {
this._restoreMaximized = this.stamp();
this.el.addClass('maximized');
this.signals.emit('maximize', this, this._restoreMaximized);
} else {
this.el.removeClass('maximized');
this.signals.emit('restore', this, this._restoreMaximized);
}
this._maximized = value;
Expand Down Expand Up @@ -2565,17 +2569,18 @@ define('src/main', [
'handlebars',
'ventus'
], function () {
});

// Register in the values from the outer closure for common dependencies
// as local almond modules
define('$', function () {
return jQuery;
});

define('underscore', function () {
return _;
});

return require('ventus');
}));
});

// Register in the values from the outer closure for common dependencies
// as local almond modules
define('$', function () {
return jQuery;
});

define('underscore', function () {
return _;
});

return require('ventus');
}));

4 changes: 2 additions & 2 deletions dist/ventus.min.js

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ var gulp = require('gulp'),
declare = require('gulp-declare'),
defineModule = require('gulp-define-module'),
del = require('del'),
mochaPhantomJS = require('gulp-mocha-phantomjs');
mochaPhantomJS = require('gulp-mocha-phantomjs'),
frep = require('gulp-frep');

var paths = {
build: 'dist',
Expand All @@ -21,6 +22,15 @@ var paths = {
var package = require('./package.json'),
jshintConfig = require('./jshint.json');

// On Windows, Handlebar templates replace \n characters with \r\n characters
// This pattern undos this, ensuring only \n characters are used in template
var pattern = [
{
pattern: /\\r\\n/g,
replacement: '\\n'
}
]

gulp.task('compile:dev', function() {
return gulp.src([
paths.vendor + '/almond',
Expand Down Expand Up @@ -69,6 +79,7 @@ gulp.task('less', function () {
gulp.task('templates', function(){
gulp.src(paths.source + '/**/*.hbs')
.pipe(handlebars())
.pipe(frep(pattern))
.pipe(defineModule('amd'))
.pipe(gulp.dest(paths.source));
});
Expand Down
Loading

0 comments on commit 5d3be8b

Please sign in to comment.