Skip to content

Commit

Permalink
only generate srcset if it's a leafpub pic
Browse files Browse the repository at this point in the history
  • Loading branch information
karsasmus committed Jun 15, 2017
1 parent 98893e5 commit b62dc8e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/source/scripts/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,11 +609,14 @@ var Editor;
} else if(cmd === 'insert') {
var generateSrcSet = function(path, sign){
var srcSet = '';
for (var i = 1; i <= 10; i++){
var widthP = i*200;
srcSet += path + '?width=' + widthP + '&sign=' + sign + ' ' + widthP + 'w,';
if (sign.length){
for (var i = 1; i <= 10; i++){
var widthP = i*200;
srcSet += path + '?width=' + widthP + '&sign=' + sign + ' ' + widthP + 'w,';
}
return srcSet.slice(0, srcSet.length - 1);
}
return srcSet.slice(0, srcSet.length - 1);
return null;
};

editor.undoManager.transact(function () {
Expand Down

0 comments on commit b62dc8e

Please sign in to comment.