TinyMCE won't display properly in Fancybox on second view in IE8 - ruby-on-rails

I'm using a fancybox to display a form with a tinyMCE inside it in a rails app. The first time I open the fancybox it works fine, but when I close it and reopen it, the initial value of the tinyMCE doesn't appear until I type a character into the tinyMCE.
Upon debugging, I found that the first time I close the fancybox, I get an error where 'window.parent.tinyMCE' is null or not an object, but I'm not sure how to go about fixing it. Does anyone know how to make sure the tinyMCE shows the initial value on load?

I figured it out in case anyone is having this issue -- in the afterShow callback, I added tinyMCE.get(editor_id).initContentBody();

Related

Modal window don't work times to times in any browser

I create application on ruby on rails and add modal window for login. I put modal code in partial layouts/header. I expect it must work on every page of my app but not. Modal don't open in home/index. It's start work on home/about. I don't understand why. I'll update my ask If needs code. Can anyone help me understand?
I try to move modal code on another pages but get same effect.
home/index and home/about is URI?
Make sure you use the same layout (header file) and the modal element exist in HTML of home/index (you can use dev tool - f12 for checking)
Please, Does the modal need to be triggered by a button or something?

Select2 - Add pending tag after losing focus

I am trying to use select2 for creating tags, but when I'm writing a new tag and I lose the focus of the field (click somewhere else, for example) what I was writing gets deleted.
Is there a way that after losing focus to the input of the select2, a new tag gets created?
From the documentation:
$('select').select2({
selectOnClose: true
});
This will capture the selection and create a tag if the user clicks elsewhere.
It looks like the browser problem that i've seen.
It seems that the tags option doesn't work correctly on ie11.
I don't have the same behavior between ie11 and chrome (and edge). If you check the example https://select2.github.io/examples.html#tags with ie, it is not possible to add tag. You can start taping letter but you lose the focus immediately.
Everything works on Chrome and Edge.
Is it this sort of problem, you've got.

JQM Popup doesn't popup when url has GET details in it

I have a page which displays a calendar/diary and lets you navigate back and forth using a form so the URL often looks like:
calendar.php?&month=6&year=2014
The popup works fine initially before there is any string after the .php. However, once the "&month=" etc is there the popup doesn't work. I note as soon as the popup loads it shows up #&ui-state=dialog in the url.
Is there a simple solution for this? (Other than changing the form to method=post, which I haven't yet tried).
Many thanks.
The simplest solution is to add:
data-history="false"
to your popup <div>. That will avoid URL modification when the popup is open.

jqm 1.1.0 closing dialogs when hashListeningEnabled=false

i've got a page that displays a dialog on an href. am setting hashListeningEnabled=false because if someone refreshes the page, they need to be greeted with the first 'page' again. when the dialog is clicked it comes up fine, clicking the close button however does nothing - it changes the href (via history.back()), but as listening is disabled, it doesn't actually close the dialog.
anyone think of a workaround?
that'd be right - as soon as i post the question on SO, i work it out myself. you simply turn hashListeningEnabled on when the dialog is shown, then you can turn it back off.

Using codemirror in jquery.ui.dialog loses focus onload

i try to use codemirror in a jquery ui dialog.
here you can see the result in jsfiddle.
http://jsfiddle.net/HtntY/
the problem is that the content in codemirror does not appear on first load. it only appears after you set focus on the editor and than type something, after that the preloaded content appears.
can this be fixed somehow. i tried to do it with the refresh() function without success.
thanks for you short time.
Looks like jQuery UI hasn't actually unhid the DIV when the opener runs. Putting a refresh call in a timeout (as in http://jsfiddle.net/NP9SL/ ) seems to do the trick.
I ran into the same problem and wound up running the editor.refresh() off the focus event, FWIW. I thought I'd mention another, somewhat related problem. If you try to take advantage of the CodeMirror dialog/search functionality inside of JQueryUI modal dialog, the integrated search dialog fails to get focus and you can't type into it. Interestingly I can paste text into the search field, but I cant type. Have yet to find a way around this other than setting modal to false.

Resources