Topic Closed
a2exfr
242 Posts
24.5K Downloads
2 Themes
10 Plugins

In version lower TS 5.0 I can use autocompete in edition section like this

$("input").autocomplete({ source : some_var })

but in 5.01 this work only for input in admin part

Edited: 4 years ago#8750

Josh S.
2K Posts
266K Downloads
16 Themes
18 Plugins

I'm guessing this has to do with where the javascript is being added to the page...Are you adding it directly to the template.php file?

5.0-rc1 is the first release to attempt moving all javascript to the bottom of the page instead of at the top. This feature is likely going to have to be optional (opt-in).

4 years ago#8751

a2exfr
242 Posts
24.5K Downloads
2 Themes
10 Plugins

Not in template.php 

It's in js-file for editing section. And input apears in editor.

  static function InlineEdit_Scripts($scripts,$type) {
    if( $type !== 'my_section' ) {
      return $scripts;
    }
    global     $addonRelativeCode;
    $scripts[] = $addonRelativeCode.'/js/edit.js';   --here adding input and autocomplete

    return $scripts;
  }

4 years ago#8752

a2exfr
242 Posts
24.5K Downloads
2 Themes
10 Plugins
I mean that  the same edit.js file work fine with autocompete in 4.6 and do not work in 5.0
4 years ago#8754

Josh S.
2K Posts
266K Downloads
16 Themes
18 Plugins

Sorry, you did say "in editing section"...

I can't think of anything else that would cause autocomplete to stop working though.

If it were me, I'd check the following:

  • Check for js errors in browser console
  • Make sure some_var actually has a value when it's passed to autocomplete. eg:

console.log(some_var);

$("input").autocomplete({ source : some_var })

  • Make sure the input field you want is actually being found. eg:

<input id="my_input_field"/>

....

console.log('Found?', $("#my_input_field").length );

$("#my_input_field").autocomplete({ source : some_var });

 

I know these may seem like trivial things to check, but  when things don't go the way we expect them, it's often the things we take for granted that are the problem.

4 years ago#8755

a2exfr
242 Posts
24.5K Downloads
2 Themes
10 Plugins

Well. All check is good, and actually it is works.

It is a css issue. Autocomplete in new version appears under ckeditor.

When I change z-index:0 for

<div id="ckeditor_wrap" class="nodisplay show_editor" 

 autocomplete is visible.

May be that is already fixed in dev? I don't know, but for Typesetter_5.0-rc1it is not.

We need to set greater z-index for autocomplete lists than for editor panel.

 

4 years ago#8758

juergen
1.4K Posts
51.4K Downloads
16 Plugins
design, web development & visual effects
yep, the autocomplete z-index issue is already fixed in dev branch.
4 years ago#8763

Josh S.
2K Posts
266K Downloads
16 Themes
18 Plugins

Yes, fixed on the dev branch and was merged into master for the 5.0-rc1 release.

when I change z-index:0 for <div id="ckeditor_wrap" class="nodisplay show_editor" 

A z-index of 0 for ckeditor_wrap would break the editor display so that's not going to work.

Instead, have you tried changing to z-index of your autocomplete? You can also change where the autocomplete is attached:

$(input)
    .css({'position':'relative',zIndex:12000})
    .autocomplete({
        appendTo    : '#gp_admin_html',
        ...

4 years ago#8764

a2exfr
242 Posts
24.5K Downloads
2 Themes
10 Plugins

This help. Pointing only needed input.

open: function () {
    $(this).autocomplete('widget').zIndex(12000);
}

But when I choose(click) something from autocompelte list, my section editing panel closing and I see section managment panel.  Value from list selected and saved but i need to re-open editing my section.

This is only for  new version qwestion, in stable all good, dont think that script is completelly wrong.

Any ideas why it's happening?

in short: selecting from autocomplete list is closing editing section dialog.

Edited: 4 years ago#8779

Josh S.
2K Posts
266K Downloads
16 Themes
18 Plugins

Yeah, just make sure the autocomplete widget is appended to <div id="gp_admin_html">

$(input)
    .autocomplete({
        appendTo    : '#gp_admin_html',

4 years ago#8786

a2exfr
242 Posts
24.5K Downloads
2 Themes
10 Plugins

 appendTo    : '#gp_admin_html',

Yes!!! Now  it's work as supposed to be! Thanks!

Edited: 4 years ago#8787

Topic Closed

 

News

Typesetter 5.1
8/12/2017

Typesetter 5.0.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

Over 8 Times Faster Than Wordpress
5/3/2016

We've known for a long time that Typesetter is fast. It's something we take pride ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register