You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a requirement to limit the cut command to files only, not directories. I knew that I needed to override the getstate function of that command as shown below:
This discussion was converted from issue #3269 on June 10, 2021 07:21.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I had a requirement to limit the
cut
command to files only, not directories. I knew that I needed to override thegetstate
function of that command as shown below:elFinder/js/commands/cut.js
Lines 16 to 21 in bc6a08b
I struggled how to achieve this without replacing the entire command as shown in Overriding the “Open” Menu Item in elFinder.
Then I came across the question How to change function inside constructor in JavaScript? which allowed me to achieve what I wanted. The solution below can be added to bootCallback function in the configuration options.
I hope this helps others as it took me a while to figure out. If anyone has a more elegant way to achieve the same result please share!
Beta Was this translation helpful? Give feedback.
All reactions