Skip to content

Commit

Permalink
Merge branch '2.1.2' into fix_grunt_watch_server
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschylus committed Nov 11, 2016
2 parents bf3fcb8 + 22d4695 commit cc76028
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 12 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ node_js:
- '5'
before_install:
- npm install
- npm install -g bower
- bower install
# before-script:
# - grunt test cover
script:
Expand Down
5 changes: 0 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,8 @@
"URIjs": "https://github.com/medialize/URI.js.git#~1.13.2",
"paper": "git://github.com/paperjs/paper.js.git#*",
"spectrum": "git://github.com/bgrins/spectrum.git#*",
"jquery-awesome-cursor": "git://github.com/jwarby/jquery-awesome-cursor.git#*",
"qtip2": "~2.2.1"
},
"devDependencies": {
"sinon-server": "http://sinonjs.org/releases/sinon-server-1.12.2.js",
"jasmine-jquery": "~2.0.6"
},
"resolutions": {
"jquery": ">=1.7.2"
}
Expand Down
19 changes: 19 additions & 0 deletions js/src/widgets/contextControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@
move: function(color) {
_this.eventEmitter.publish('changeBorderColor.' + _this.windowId, color.toHexString());
},
show: function(color) {
_this.setColorPickerInCanvas('.borderColorPicker');
},
maxSelectionSize: 4,
color: defaultBorderColor,
palette: [
Expand Down Expand Up @@ -176,6 +179,9 @@
move: function(color) {
_this.eventEmitter.publish('changeFillColor.' + _this.windowId, [color.toHexString(), color.getAlpha()]);
},
show: function(color) {
_this.setColorPickerInCanvas('.fillColorPicker');
},
maxSelectionSize: 4,
color: colorObj,
palette: [
Expand All @@ -188,6 +194,19 @@
// _this.container.find(".fillColorPicker").next(".sp-replacer").append('<i class="fa fa-caret-down dropdown-icon"></i>');
},

setColorPickerInCanvas: function(selector) {
// check for the selector being out of canvas
var pickerContainer=this.container.find(selector).siblings('.sp-container').first(),
pickerOffset=pickerContainer.offset(),
windowWidth = this.state.windowsElements[this.windowId].width();
if (pickerContainer.width() + pickerOffset.left > windowWidth) {
pickerContainer.offset({
top: pickerOffset.top,
left: windowWidth - (pickerContainer.width())
});
}
},

annotationShow: function() {
this.annotationElement.fadeIn("150");
},
Expand Down
2 changes: 1 addition & 1 deletion js/src/workspaces/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@
_this.endpoint.set('dfd', dfd);
} else {
options.dfd = dfd;
options.windowIDwindowID = _this.id;
options.windowID = _this.id;
options.imagesList = _this.imagesList;
options.eventEmitter = _this.eventEmitter;
_this.endpoint = new $[module](options);
Expand Down
4 changes: 2 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ module.exports = function(config) {
'js/lib/spectrum.js',
'js/lib/i18next.min.js',
'js/lib/modernizr.custom.js',
'bower_components/sinon-server/index.js',
'bower_components/jasmine-jquery/lib/jasmine-jquery.js',
'node_modules/sinon/pkg/sinon.js',
'node_modules/jasmine-jquery/lib/jasmine-jquery.js',
// app
'js/src/*.js',
'js/src/viewer/*.js',
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@
"karma-phantomjs-launcher": "^1.0",
"karma-safari-launcher": "^0.1.1",
"karma-sauce-launcher": "^0.2.10",
"karma-spec-reporter": "^0.0.16"
"karma-spec-reporter": "^0.0.16",
"sinon": "^1.17.6"
},
"scripts": {
"start": "grunt serve",
"test": "./node_modules/.bin/karma start ./karma.conf.js",
"travis": "./node_modules/grunt-cli/bin/grunt ci --verbose --force & npm run test"
},
"dependencies": {}
"dependencies": {},
"engine": "node < 7.0.0"
}

0 comments on commit cc76028

Please sign in to comment.