Bug 965711 - [VsD Refresh] Homescreen/E.Me - Implement visual refresh to smart collections icons #16343
Bug 965711 - [VsD Refresh] Homescreen/E.Me - Implement visual refresh to smart collections icons #16343
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,47 @@ | |
} | ||
} | ||
|
||
function updateCollectionBgImage(collectionSettings) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. refactor. this method is now used in 2 places. see below. |
||
var request; | ||
|
||
var p = new window.Promise(function handler(resolve, reject) { | ||
var query = collectionSettings.getQuery(), | ||
checksum = collectionSettings.bg ? | ||
collectionSettings.bg.checksum : null; | ||
|
||
request = Evme.DoATAPI.bgimage({ | ||
'_checksum': checksum, | ||
'query': query, | ||
'feature': SEARCH_SOURCES.SHORTCUT_COLLECTION, | ||
'exact': true, | ||
'width': Evme.__config.bgImageSize[0], | ||
'height': Evme.__config.bgImageSize[1] | ||
}, function onSuccess(data) { | ||
if (data.response) { | ||
Evme.Collection.update(collectionSettings, { | ||
'bg': { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the stored bg object |
||
'checksum': data.checksum, | ||
'url': data.response.source, | ||
'data': Evme.Utils.formatImageData(data.response.image), | ||
'revision': data.response.image.revision | ||
} | ||
}, resolve); | ||
} else { | ||
reject(); | ||
} | ||
}); | ||
}); | ||
|
||
// for backwards compatibility we return an 'abortable' object | ||
p.abort = function abortWrapper() { | ||
if (request.abort) { | ||
request.abort(); | ||
} | ||
}; | ||
|
||
return p; | ||
} | ||
|
||
/* EVENT HANDLERS */ | ||
|
||
// Core.js | ||
|
@@ -994,25 +1035,12 @@ | |
} | ||
|
||
function loadBGImage() { | ||
if (!Evme.Collection.isOpen()) { return; } | ||
if (Evme.Collection.userSetBg()) { return; } | ||
|
||
var query = Evme.Collection.getQuery(); | ||
|
||
requestCollectionImage = Evme.DoATAPI.bgimage({ | ||
'query': query, | ||
'feature': SEARCH_SOURCES.SHORTCUT_COLLECTION, | ||
'exact': true, | ||
'width': Evme.__config.bgImageSize[0], | ||
'height': Evme.__config.bgImageSize[1] | ||
}, function onSuccess(data) { | ||
Evme.Collection.setBackground({ | ||
'image': Evme.Utils.formatImageData(data.response.image), | ||
'query': query, | ||
'source': data.response.source, | ||
'setByUser': false | ||
}); | ||
var collectionSettings = Evme.Collection.getCurrentSettings(); | ||
|
||
requestCollectionImage = updateCollectionBgImage(collectionSettings); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
requestCollectionImage.then(function resolved() { | ||
requestCollectionImage = null; | ||
}, function rejected() { | ||
requestCollectionImage = null; | ||
}); | ||
} | ||
|
@@ -1305,6 +1333,8 @@ | |
Evme.Collection.update(collectionSettings, { | ||
'extraIconsData': extraIconsData | ||
}); | ||
|
||
updateCollectionBgImage(collectionSettings); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
}); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -292,8 +292,6 @@ window.Evme = new function Evme_Core() { | |
|
||
Evme.InstalledAppsService.init(); | ||
|
||
Evme.IconGroup.init({}); | ||
|
||
Evme.IconManager.init({}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IconGroup deprecated |
||
|
||
Evme.SearchHistory.init({ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,6 +240,7 @@ Evme.DoATAPI = new function Evme_DoATAPI() { | |
!options && (options = {}); | ||
|
||
var params = { | ||
'_checksum': options._checksum || '', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. send |
||
'query': options.query, | ||
'experienceId': options.experienceId || '', | ||
'typeHint': options.typeHint || '', | ||
|
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.
deprecated: settings for old collection icon version