Closed imTachu closed 7 years ago
Does the directive handle the coping part or you just need to select the text?
I think that you might need to use a handle.
If you actually need to check the DOM element that was clicked, you can do something like if ($(e.originalEvent.target).is('span')) { /*...*/ }
.
But, since cancel()
only reverts the sorting after the dragging, you might want to take a look at the cancel
option as well.
Any feedback on this?
So sorry! I forgot to tell you, it was solved like this:
<tbody ui-sortable="sortableOptions" ng-model="aModel">
$scope.sortableOptions = {
cancel: 'pn-custom id, .input-sm'
};
To me, it looks very clean and works very well:
WDYT?
Yea, that's exactly what I was thinking of. 👍 for making it work and 👍 for sharing back your findings.
I'm sorry if this has been addressed before, I couldn't find it. I want to allow users to copy the text inside the rows of a
ui-sortable
table. In specific in this case, thepn-custom
directive only contains aspan
with text. That is the text I want to allow to be copied.Of what I've read in the README file, I should use a cancel? Is this wrong? Is there any simple way to achieve this that I'm ignoring?
The reason why I post this here and not in SO is because if I think this is a simple use case, and if I can fix I would like to document it in the README.md file.