New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable / disable editors individually #1073
base: master
Are you sure you want to change the base?
Conversation
…lfilled) yabwe#180 + toArr method of the Utils as a shortcut for [].prototype.slice.call()
changed to .call due to perfomance.
--characters of code
@houd1ni sorry for taking so long to look at this. My first question is, is there any reason you wouldn't just set |
@nmielnik we discussed it in gitter a month ago. You'd suggested this approach, then I've tried and faild at least in cases like |
}, | ||
|
||
toArr: function (arraylike) { | ||
return [].slice.call(arraylike); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a benefit to calling [].slice()
as opposed to Array.prototype.slice
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for megaslow response. Yes: it's just a bit smaller :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But now I'm not sure that is's not slower. Gonna test it.
Ah yes, thanks for reminding me! So looks like I created a merge conflict for you with some of the changes that I merged in, apologies for that but we'll want to get that fixed first. I can try to help out with writing tests and what-not if that's what you were looking for, or were you looking for additional feedback on the change and pointers on how to add some tests? |
@@ -231,6 +231,21 @@ | |||
}, this); | |||
} | |||
|
|||
function offDisabledElements(elements) { | |||
// Should be checked that it exists outside the func. | |||
elements.forEach(function (element) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once you merge the latest master into your branch, you'll likely want to move this logic into initElement
. It's a function that will be called for every editor element during initialization and when elements are added dynamically.
Im alive, will take a look on this soon :) |
Original issue: #180
I failed to write the test: only created an appropriate shell for it.
I'm quite new in this kind of testing, so I just describe my approach.
The test has failed, though I'd added a child element with
.className='disableClass'
right options{disable: '.disableClass'}
and actually in manual testing with debug tools, in at least chrome, events haven't been fired: theselectiveListener
shell returns before an original Event.