Merge remote-tracking branch 'origin/ooimage' into staging

pull/1/head
ansuz 4 years ago
commit 534b6789d2

@ -1457,6 +1457,25 @@ define([
// Add image to the list // Add image to the list
var mediasSources = getMediasSources(); var mediasSources = getMediasSources();
// Check if name already exists
var getUniqueName = function (name, mediasSources) {
var get = function () {
var s = name.split('.');
if (s.length > 1) {
s[s.length - 2] = s[s.length - 2] + '-' + Util.uid();
name = s.join('.');
} else {
name += '-'+ Util.uid();
}
};
while (mediasSources[name]) { get(); }
return name;
};
if (mediasSources[name]) {
name = getUniqueName(name, mediasSources);
data.name = name;
}
mediasSources[name] = data; mediasSources[name] = data;
APP.onLocal(); APP.onLocal();

Loading…
Cancel
Save