Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2017-08-29 13:50:05 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2017-08-29 13:50:05 +0300
commit4a120d77a7269f8f9291ca925bced62f5813865f (patch)
tree7c5e0dd4ef2428759d6d5f24f4e25c4a4140f0c5
parent30e069d9ed5b02ef6d40f61a058c7e70dd7f2a99 (diff)
Update autosize to a recent version and load it as module
Newer versions of autosize are independent of jQuery and can be loaded as a proper module. Hence we don't have to include it in the template and save another request per pageload Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r--js/tests/test-main.js4
-rw-r--r--js/views/composerview.js3
-rw-r--r--package.json2
-rw-r--r--templates/index.php1
4 files changed, 3 insertions, 7 deletions
diff --git a/js/tests/test-main.js b/js/tests/test-main.js
index 8982aa8d7..a0bda72f1 100644
--- a/js/tests/test-main.js
+++ b/js/tests/test-main.js
@@ -60,10 +60,6 @@ $.fn.tooltip = function() {
};
-$.fn.autosize = function() {
-
-};
-
$.fn.droppable = function() {
};
diff --git a/js/views/composerview.js b/js/views/composerview.js
index 47aad3170..056111608 100644
--- a/js/views/composerview.js
+++ b/js/views/composerview.js
@@ -14,6 +14,7 @@ define(function(require) {
var Marionette = require('backbone.marionette');
var $ = require('jquery');
var _ = require('underscore');
+ var autosize = require('autosize');
var OC = require('OC');
var Radio = require('radio');
var Attachments = require('models/attachments');
@@ -154,7 +155,7 @@ define(function(require) {
setAutoSize: function(state) {
if (state === true) {
if (!this.autosized) {
- this.$('textarea').autosize({append: '\n\n'});
+ autosize(this.$('textarea'), {append: '\n\n'});
this.autosized = true;
}
this.$('.message-body').trigger('autosize.resize');
diff --git a/package.json b/package.json
index db2ce16ee..b5065c934 100644
--- a/package.json
+++ b/package.json
@@ -51,7 +51,7 @@
"webpack": "^3.5.5"
},
"dependencies": {
- "autosize": "1.18.13",
+ "autosize": "^4.0.0",
"backbone": "^1.3.3",
"backbone.babysitter": "^0.1.12",
"backbone.marionette": "^3.0.0",
diff --git a/templates/index.php b/templates/index.php
index f0a75f736..12ab64af2 100644
--- a/templates/index.php
+++ b/templates/index.php
@@ -25,7 +25,6 @@
*/
style('mail', 'mail');
style('mail', 'mobile');
-script('mail', '../node_modules/autosize/build/jquery.autosize');
script('mail', 'searchproxy');
script('mail', 'build/build');
?>