ZSSRichTextEditor
ZSSRichTextEditor copied to clipboard
How to know ZSSRichTextEditor focus in/out?
i want to konw ZSSRichTextEditor focus in/out , like uitextfield textFieldShouldBeginEditing.
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 } }