ZSSRichTextEditor icon indicating copy to clipboard operation
ZSSRichTextEditor copied to clipboard

How to know ZSSRichTextEditor focus in/out?

Open laoshiren0822 opened this issue 6 years ago • 1 comments

i want to konw ZSSRichTextEditor focus in/out , like uitextfield textFieldShouldBeginEditing.

laoshiren0822 avatar Jan 18 '18 03:01 laoshiren0822

i managed to do it by inserting

window.location = "sam://isActive"; in $(document).on('selectionchange',function(e) in init function of ZSSRichTextEditor.js for in-focus

and $(document).on("focusout", function() {window.location = "sam://isNotActive";}); in init function for focus-out.

and in - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

add

if ([urlString rangeOfString:@"sam://"].location != NSNotFound) { if ([urlString hasSuffix:@"isActive"]) { // is in focus } else if ([urlString hasSuffix:@"isNotActive"]) { // is out of focus } }

sameer4 avatar Jun 29 '18 17:06 sameer4