-
Notifications
You must be signed in to change notification settings - Fork 32
Fix scribing scaling #366
Fix scribing scaling #366
Conversation
@@ -82,7 +113,7 @@ function loadScribble(c, scribble, layersList) { | |||
.attr('selected','selected'); | |||
layersList.append(newLayerEntry); | |||
|
|||
var toggleLayer = function (showLayer) { | |||
function toggleLayer(showLayer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.
@kxmbrian I occasionally found this: https://github.com/Coursemology/coursemology.org/blob/development/app/models/assessment/submission.rb#L23 I think it's a typo ? |
Good catch. It seems like neither general_answers or scribing_answers are invoked anywhere. Should I be commenting / removing the unnecessary code actually? |
Yah. seems no where called general_answers so nothing was broken. But better fix it in case someone called it in future. |
if (newJSON !== oldJSON) { | ||
ajaxField.data('content', newJSON); | ||
$.ajax({ | ||
type: "POST", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixed double and single quotes.
//adapted from | ||
//http://stackoverflow.com/questions/19682706/how-do-you-close-the-iris-colour-picker-when-you-click-away-from-it | ||
$(document).click(function(e) { | ||
if (!$(e.target).is('.scribing-color-val .iris-picker .iris-picker-inner')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
var newLeft = viewportLeft + deltaLeft; | ||
var newTop = viewportTop + deltaTop; | ||
tryPan(newLeft, newTop); | ||
} else if (options['isForced']) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['isForced'] is better written in dot notation.
…g into fix-scribing-scaling
@wangqiang1208, this feature is currently frozen and ready for a final check before merge. Could you help to review? |
@wangqiang1208, good to merge? |
<input type="text" class="scribing-color-val" id="scribing-color-<%= qid %>"></input> | ||
<input type="range" id="scribing-width-<%= qid %>" value="2" min="0" max="30" style="width: 100px"></input> | ||
<div class="panel"> | ||
<input type="text" class="scribing-color-val" id="scribing-color-<%= qid %>"></input> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not aligned here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsyeo it was here
@kxmbrian @jsyeo I've tested this PR, Tests on Safari and Chrome shows that #336 is fixed. I haven't looked at javascript code. And this PR seems only changed the scribing related stuff, so should not have side effects on other assessment parts. Except some minor issues, I think this is good to merge. |
@wangqiang1208 minor issues? |
@jsyeo Sorry, didn't notice your message, this can be merged. |
What are the minor issues? |
See my comments, actually just line alignments. On Wednesday, January 28, 2015, Jason Yeo [email protected] wrote:
|
Which one? |
Cannot find the last outdated one ? On Wednesday, January 28, 2015, Jason Yeo [email protected] wrote:
|
@kxmbrian please split your PR next time. You are trying to fix 2-3 issues here. A bit hard for me and @wangqiang1208 to review. Thanks. 😄 |
@jsyeo What should I do if one PR is built on a previous PR that has not been merged? |
@kxmbrian just have to let us know that the PR depends on another PR. (e.g. Coursemology/coursemology2#78 (comment)) I will merge the one that is depended on first. |
ok thanks 👍 |
Fix for #336. Scribbles should now display consistently on different browser / screen / canvas sizes.
Other minor improvements also included.