mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-28 18:15:37 -05:00
resolve conflicts and lint the code
This commit is contained in:
commit
dab8462349
4 changed files with 28 additions and 3 deletions
|
@ -107,6 +107,9 @@ export default class Sprite {
|
|||
|
||||
setCostume (dataurl, fcn) {
|
||||
var img = document.createElement('img');
|
||||
img.ondragstart = function () {
|
||||
return false;
|
||||
};
|
||||
img.src = dataurl;
|
||||
this.img = img;
|
||||
// Make a copy that is not affected by zoom transformation
|
||||
|
|
|
@ -201,6 +201,9 @@ export default class Library {
|
|||
img.style.top = (7 * scaleMultiplier) + 'px';
|
||||
img.style.position = 'relative';
|
||||
img.style.height = (data.height * scale) + 'px';
|
||||
img.ondragstart = function () {
|
||||
return false;
|
||||
};
|
||||
if (data.altmd5) {
|
||||
IO.getAsset(data.altmd5, drawMe);
|
||||
}
|
||||
|
|
|
@ -111,6 +111,7 @@ function indexSetAnalyticsPrefs () {
|
|||
function indexLoadStart () {
|
||||
indexHideSplash();
|
||||
showLogo();
|
||||
showGear();
|
||||
gn('gettings').className = 'gettings show';
|
||||
gn('startcode').className = 'startcode show';
|
||||
|
||||
|
@ -146,6 +147,14 @@ function showLogo () {
|
|||
gn('jrlogo').className = 'jrlogo show';
|
||||
}
|
||||
|
||||
function hideGear () {
|
||||
gn('gear').className = 'gear hide';
|
||||
}
|
||||
|
||||
function showGear () {
|
||||
gn('gear').className = 'gear show';
|
||||
}
|
||||
|
||||
function indexAskPlace () {
|
||||
gn('authors').className = 'credits show';
|
||||
gn('authorsText').className = 'creditsText hide';
|
||||
|
@ -206,7 +215,7 @@ function indexHidePlaceQuestion () {
|
|||
gn('usageNoanswer').className = 'usageNoanswer hide';
|
||||
}
|
||||
|
||||
function optionTouched (elem) {
|
||||
function optionSelected (elem) {
|
||||
var key = elem.target.getAttribute('data-key');
|
||||
var value = elem.target.getAttribute('data-value');
|
||||
// sometimes a touch is registered by a child of the relevant parent
|
||||
|
@ -230,6 +239,7 @@ function optionTouched (elem) {
|
|||
function indexShowQuestion (key) {
|
||||
indexHideSplash();
|
||||
hideLogo();
|
||||
hideGear();
|
||||
var optionType = InitialOptions.optionTypeForKey(key);
|
||||
if (optionType === 'place_preference') {
|
||||
indexAskPlace();
|
||||
|
@ -258,7 +268,7 @@ function indexShowQuestion (key) {
|
|||
optionElem.setAttribute('data-key', key);
|
||||
optionElem.setAttribute('data-value', option);
|
||||
optionElem.setAttribute('id', 'option-' + key + '-' + optionNum);
|
||||
optionElem.onclick = optionTouched;
|
||||
optionElem.onclick = optionSelected;
|
||||
optionsListElem.appendChild(optionElem);
|
||||
|
||||
switch (optionType) {
|
||||
|
@ -276,6 +286,15 @@ function indexShowQuestion (key) {
|
|||
}
|
||||
optionNum = optionNum + 1;
|
||||
});
|
||||
// iPad mini has the minimum screen size, it can show 13 items in one column
|
||||
// and we use 3 columns as default
|
||||
if (optionNum > 13 * 5) {
|
||||
gn('optionsList').style['column-count'] = 8;
|
||||
} else if (optionNum > 13 * 3) {
|
||||
gn('optionsList').style['column-count'] = 5;
|
||||
} else {
|
||||
gn('optionsList').style['column-count'] = 3;
|
||||
}
|
||||
gn('optionsList').className = 'optionsList show';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ export default class Home {
|
|||
//////////////////////////
|
||||
|
||||
static handleTouchStart (e) {
|
||||
// On my android tablet, when touching a project,
|
||||
// On my android tablet, when touching a project,
|
||||
// the tablet triggers the mousedown event
|
||||
// after touchstart event about 600ms
|
||||
// --Donald
|
||||
|
|
Loading…
Reference in a new issue