Skip to content

Commit

Permalink
fix: each on tab slug
Browse files Browse the repository at this point in the history
- button add css block
- css top spacing between input same as form engine
- delete each entry bug fix
  • Loading branch information
nicolaslabbe committed Feb 2, 2017
1 parent 2738f45 commit 1e241e3
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 18 deletions.
2 changes: 2 additions & 0 deletions src/cli/cms/Page.js
Expand Up @@ -46,6 +46,8 @@ export default class Page {
// Remove text with attribute "visible=false"
this.template = cmsTemplates.prepare.removeHiddenAbeTag(this.template)

// remove abe type="slug" from template
this.template = this.template.replace(/({{abe.*type=[\'|\"]slug.*}})/g, '')
if(!this._onlyHTML){
// Surrounds each Abe tag (which are text/rich/textarea and not in html attribute) with <abe> tag
// ie. <title><abe>{{abe type='text' key='meta_title' desc='Meta title' tab='Meta' order='4000'}}</abe></title>
Expand Down
2 changes: 1 addition & 1 deletion src/server/public/abecms/css/styles.css

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/server/public/abecms/scripts/modules/EditorBlock.js
Expand Up @@ -32,7 +32,7 @@ export default class EditorBlock {
this.smiley = new smiley(imgWysiwyg)
}

this._removeblock = [].slice.call(document.querySelectorAll('.list-group[data-block]'))
this._removeblock = [].slice.call(document.querySelectorAll('.list-group[data-block] .remove-block'))
this._handleClickRemoveBlock = this._clickRemoveBlock.bind(this)

this._addblock = [].slice.call(document.querySelectorAll('.add-block'))
Expand Down Expand Up @@ -94,7 +94,9 @@ export default class EditorBlock {
Array.prototype.forEach.call(child.querySelectorAll('.form-abe'), (item) => {
item.value = ''
})
delete abe.json._data[blockAttr][0]
if (abe.json != null && abe.json._data[blockAttr] != null) {
delete abe.json._data[blockAttr][0]
}
}
else{
var toRemove = null
Expand Down
19 changes: 14 additions & 5 deletions src/server/public/abecms/scripts/modules/FormCreate.js
Expand Up @@ -44,12 +44,21 @@ export default class FormCreate {
}

window.abe.blocks.onNewBlock(() => {
this._formInputs = [].slice.call(this._form.querySelectorAll('input, select'))
Array.prototype.forEach.call(this._formInputs, function(input) {
input.removeEventListener('blur', this._handleBlurEvent)
input.addEventListener('blur', this._handleBlurEvent)
}.bind(this))
this._updateBlocks()
})

window.abe.blocks.onRemoveBlock(() => {
this._updateBlocks()
})
}

_updateBlocks() {
this._formInputs = [].slice.call(this._form.querySelectorAll('input, select'))
Array.prototype.forEach.call(this._formInputs, function(input) {
input.removeEventListener('blur', this._handleBlurEvent)
input.addEventListener('blur', this._handleBlurEvent)
}.bind(this))
this._setSlug(false)
}

_bindEvents() {
Expand Down
2 changes: 2 additions & 0 deletions src/server/sass/modules/_editor-blocks.scss
Expand Up @@ -2,9 +2,11 @@
border-right: 1px solid #e3e3e3;
}

.manager-wrapper .form-wrapper form,
.form-wrapper form {
.add-block,
.remove-block {
width: inherit;
border-radius: 0px;
}
.remove-block {
Expand Down
14 changes: 4 additions & 10 deletions src/server/sass/modules/_editor.scss
Expand Up @@ -32,10 +32,6 @@
display: none;
}

.form-group {
margin-bottom: 0px;
}

select,
input {
min-height: 30px;
Expand Down Expand Up @@ -98,12 +94,10 @@
}

.form-wrapper{
.status-draft{
.list-block{
&:hover{
[data-toggle="collapse"]{
width: calc(100% - 40px);
}
.list-block{
&:hover{
[data-toggle="collapse"]{
width: calc(100% - 40px);
}
}
}
Expand Down

0 comments on commit 1e241e3

Please sign in to comment.