Skip to content

Commit

Permalink
Fix being unable to post for Super Table in Matrix fields
Browse files Browse the repository at this point in the history
  • Loading branch information
engram-design committed Jul 26, 2020
1 parent 68a8864 commit a7911be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/resources/dist/js/smith.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/resources/dist/js/smith.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions src/resources/src/js/smith.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ Craft.Smith.Menu = Garnish.Base.extend({

try {
var data = JSON.parse(localStorage.getItem('smith:block'));
var fieldHandle = this.$matrixField.attr('id').replace('fields-', '');
var fieldHandle = this.$matrixField.attr('id');

// Find copy data for this field
if (data && data.field == fieldHandle) {
if (data && fieldHandle.includes('fields-' + data.field)) {
canPaste = true;
}
} catch(e) { }
Expand Down Expand Up @@ -238,9 +238,6 @@ Craft.Smith.Menu = Garnish.Base.extend({
var levelsDeep = $blockItem.parents('.field').length;
var isNested = (levelsDeep > 1) ? true : false;

// console.log(isNested)
// console.log(postData)

if (isNested) {
var parsedPostData = {};

Expand Down Expand Up @@ -271,8 +268,6 @@ Craft.Smith.Menu = Garnish.Base.extend({
}
}

// console.log(data)

return data;
},

Expand Down

0 comments on commit a7911be

Please sign in to comment.