Browse Source

Update onLoad blocks

pull/406/head
Artur Arseniev 9 years ago
parent
commit
2db17ffc49
  1. 11
      README.md
  2. 8
      dist/grapes.min.js
  3. 1
      index.html
  4. 15
      package.json
  5. 6
      src/block_manager/index.js

11
README.md

@ -38,7 +38,6 @@ Newsletter Demo - http://grapesjs.com/demo-newsletter-editor.html
* [API](#api) * [API](#api)
* [Testing](#testing) * [Testing](#testing)
* [Plugins](#plugins) * [Plugins](#plugins)
* [Sponsors](#sponsors)
* [Support](#support) * [Support](#support)
* [License](#license) * [License](#license)
@ -205,16 +204,6 @@ Find out more about plugins here: [Creating plugins](https://github.com/artf/gra
## Sponsors
The project is sponsored by
[![Sendloop](http://grapesjs.com/img/sendloop-logo-l.png)](https://sendloop.com)
## Support ## Support
If you like the project support it with a donation of your choice or become a backer/sponsor via [Open Collective](https://opencollective.com/grapesjs) If you like the project support it with a donation of your choice or become a backer/sponsor via [Open Collective](https://opencollective.com/grapesjs)

8
dist/grapes.min.js

File diff suppressed because one or more lines are too long

1
index.html

@ -4,7 +4,6 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>GrapesJS</title> <title>GrapesJS</title>
<link rel="stylesheet" href="dist/css/grapes.min.css"> <link rel="stylesheet" href="dist/css/grapes.min.css">
<!-- script src="node_modules/jquery/dist/jquery.min.js"></script -->
<script src="dist/grapes.min.js"></script> <script src="dist/grapes.min.js"></script>
</head> </head>

15
package.json

@ -1,7 +1,7 @@
{ {
"name": "grapesjs", "name": "grapesjs",
"description": "Free and Open Source Web Builder Framework", "description": "Free and Open Source Web Builder Framework",
"version": "0.11.4", "version": "0.12.3",
"author": "Artur Arseniev", "author": "Artur Arseniev",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"homepage": "http://grapesjs.com", "homepage": "http://grapesjs.com",
@ -44,18 +44,15 @@
"whatwg-fetch": "^2.0.3" "whatwg-fetch": "^2.0.3"
}, },
"keywords": [ "keywords": [
"wte",
"grapes", "grapes",
"grapesjs", "grapesjs",
"web template editor",
"web site builder",
"web template builder",
"html website builder",
"site builder",
"newsletter builder",
"wysiwyg", "wysiwyg",
"web",
"template", "template",
"editor" "editor",
"newsletter",
"site",
"builder"
], ],
"babel": { "babel": {
"presets": [ "presets": [

6
src/block_manager/index.js

@ -99,11 +99,11 @@ module.exports = () => {
}, },
/** /**
* Loading blocks with `onLoad` allows to init starting collection * Load default blocks if the collection is empty
* from plugins
*/ */
onLoad() { onLoad() {
this.getAll().reset(c.blocks); const blocks = this.getAll();
!blocks.length && blocks.reset(c.blocks);
}, },
/** /**

Loading…
Cancel
Save