Skip to content

Commit

Permalink
Update add method in AssetManager, put the model at the beginning
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Sep 3, 2017
1 parent d91dc4c commit ac3a2cd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dist/grapes.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "grapesjs",
"description": "Free and Open Source Web Builder Framework",
"version": "0.9.43",
"version": "0.9.46",
"author": "Artur Arseniev",
"license": "BSD-3-Clause",
"homepage": "http://grapesjs.com",
Expand Down
14 changes: 14 additions & 0 deletions src/asset_manager/index.js
Expand Up @@ -136,6 +136,12 @@ module.exports = () => {
* }]);
*/
add(asset, opts = {}) {

// Put the model at the beginning
if (typeof opts.at == 'undefined') {
opts.at = 0;
}

return assets.add(asset, opts);
},

Expand Down Expand Up @@ -308,6 +314,14 @@ module.exports = () => {

//-------

AssetsView() {
return am;
},

FileUploader() {
return fu;
},

postRender(editorView) {
c.dropzone && fu.initDropzone(editorView);

Expand Down

0 comments on commit ac3a2cd

Please sign in to comment.