I have created a directive called pagedownAdmin with some functionality to enhance the page editor:
app.directive('pagedownAdmin', ['$compile', '$timeout', function ($compile, $timeout) {
// Directive logic here...
}]);
One of the key features is the showDiv and hideDiv functions that control the visibility of the menu when interacting with the textarea.
I tried implementing these functions using different event attributes in the HTML:
//First attempt
<textarea onfocus="showDiv()" onblur="hideDiv()"></textarea>
However, this resulted in errors being thrown:
Uncaught ReferenceError: on is not defined
Uncaught ReferenceError: off is not defined
//Second attempt
<textarea on-focus="showDiv()" on-blur="hideDiv()"></textarea>
Unfortunately, neither of these approaches worked as expected. There were no errors reported, but the functions were not being triggered upon clicking inside or outside the textarea.
If anyone has insights on how to properly utilize these functions within the context of the directive, I would greatly appreciate the guidance. Thank you!