Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
fix(avatars): allow mobile browsers to reposition the image during crop
Browse files Browse the repository at this point in the history
  • Loading branch information
zaach committed Aug 26, 2014
1 parent 3d1cca7 commit 74202ea
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app/scripts/require_config.js
Expand Up @@ -22,6 +22,10 @@ require.config({
{ name: 'draggable',
location: '../bower_components/jquery-ui/ui',
main: 'draggable'
},
{ name: 'touch-punch',
location: '../bower_components/jquery-ui-touch-punch',
main: 'jquery.ui.touch-punch'
}
],
shim: {
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/views/settings/avatar_change.js
Expand Up @@ -57,7 +57,7 @@ define([
// skip the file picker if this is an automater browser
if (this.automatedBrowser) {
var self = this;
require(['draggable'], function (ui) {
require(['draggable', 'touch-punch'], function () {
Session.set('cropImgSrc', pngSrc);
Session.set('cropImgWidth', 1);
Session.set('cropImgHeight', 1);
Expand All @@ -78,7 +78,7 @@ define([
// Store the width and height for the cropper view
Session.set('cropImgWidth', this.width);
Session.set('cropImgHeight', this.height);
require(['draggable'], function () {
require(['draggable', 'touch-punch'], function () {
self.navigate('settings/avatar/crop');
});
};
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/views/settings/avatar_url.js
Expand Up @@ -80,7 +80,7 @@ function (_, FormView, Template, Session, OAuthClient, ProfileClient, Assertion,
// Store the width and height for the cropper view
Session.set('cropImgWidth', this.width);
Session.set('cropImgHeight', this.height);
require(['draggable'], function () {
require(['draggable', 'touch-punch'], function () {
self.navigate('settings/avatar/crop');
});
};
Expand Down
3 changes: 2 additions & 1 deletion bower.json
Expand Up @@ -21,7 +21,8 @@
"tos-pp": "https://github.com/mozilla/legal-docs.git",
"underscore": "1.5.2",
"jquery-ui": "1.11.0",
"JavaScript-MD5": "1.1.0"
"JavaScript-MD5": "1.1.0",
"jquery-ui-touch-punch": "https://github.com/zaach/jquery-ui-touch-punch.git#89e5a9159494de37df1e09cccf9036dda5429830"
},
"devDependencies": {}
}

0 comments on commit 74202ea

Please sign in to comment.