-
Posts
2,321 -
Joined
-
Last visited
-
Days Won
44
Everything posted by tpr
-
Thanks but this case this signals that the field is ready, but select2.js needs asmSelect to be ready too. I used a 700ms setTimeout to fix (using the reloaded event) but that was less reliable and much slower too. In fact it may work now that I modified my stuff a lot but I think requestanimationframe works just fine, no need to swap out.
-
Minor update: instead of higlighting the searched term now the cursor is moved to the end of the text in the asmSelect search box. Re-download aos.min.js if you have already updated the module to 1.7.8 as version number haven't changed.
-
flu perhaps?
-
Ok, that thing wasn't that successful so @Karl_T's workaround was kept to keep the scroll position, thanks! Works quite well now, that was the missing piece to the cake I haven't made keeping the scroll position optional but did that for the searched term.
-
Thanks for mentioning me/AOS but I don't think AOS is comparable to Tracy Anyway, I may implement such button sometime, mainly out of curiosity. I've been in a similar situation years ago with my portable launcher (yaP) but I postponed it until... still today
-
I can make them configurable. As for the scroll position I will try your fix and also try something else.
-
That's because I wasn't sure that search term restoration is beneficial after trying it. When it's restored, you have to delete it to search for something else. For me this caused more typing because it's very rare that I will add consecutive items starting with the same string. But feel free to prove the opposite, perhaps it's just my own scenario.
-
v1.7.7 is uploaded, docs will come later I'm happy with the asmSelect + Select2 result. The jump on click is still present but I think it's a minor issue. There are also 2 extra field config settings: placeholder and limit for FieldtypePage and FieldtypeOptions, you can find it under the Input tab. Currently it's working with asmSelect variants only. I think these additions make using asmSelect much more convenient, feels native after using it once or twice @adrian That top checkbox would mess up the look a bit, but it would be handy otherways.
-
Sure, but as always, the question is where to put it. Do you have any UI idea?
-
Perhaps you could use mystyles.php with JavaScript content type header and include site specific js files from there? I'm not sure if this would work though but there's a chance.
-
Thanks @adrian, requestAnimationFrame seems to work beautifully at first, even in IE11.
-
Thanks, I'll try that way. This solution is much more useful to know than the whole feature in question
-
I had some tough night hours to figure out things but finally it seems to works as I expected. I kept the hidden items visible because it causes less frustration. Ajax loaded fields are supported though it's still a setTimeout hack, but better than nothing imho. Keeping searched term is still not solved, not sure if I can do that but I think it's still an improvement to the original asmSelect.
-
I know. The problem is that I do not want to add another button to cause unnecessary clutter especially for clients.
-
Since I rebuild the whole select2 on select and then reopen it, no need for closeOnSelect false. I couldn't remove clicked items otherwise on the fly, though possibly there's a way. There's the on/off switch in the footer if you need that.
-
Thanks @Karl_T for the help, I'm almost there now, only some minor glitches are left, eg keeping the searched term after enter. I've decided to destroy/rebuild the select2 dropdown to make sure everything work nicely with asmSelect (had issues otherwise). I've also made the greyed out items hidden, so only the selectable options are visible. Let me know if you have arguments against it. I sorted the field list alphabetically, let me know if you think it's a bad idea.
-
You mean the "Add field" asmSelect? That's already a "pimped" html select box, but I just thought today morning that it would be nice if it had a search. I'm not sure applying another js won't cause issues but I'll see if I have time. I'm usually using this library for such things btw: https://github.com/jshjohnson/Choices
-
As a workaround a select inputfield with one required choice wouldn't do?
-
I saw this follow-up question coming, ? I think that's also doable, will check that later. I reckon the same question is about to emerge for the rest of the PageField types, isn't it? ?
-
It's done, will be added to the next aos update. I've borrowed some code from @Robin S modules (thanks!) as I haven't added config inputs to fields so far. In fact I totally forgot about this asmSelect snippet of mine, thanks for the reminder
-
I haven't yet but I'll give a try.
-
+1: this removes the "New" action if there is no room for more children. I haven't tested it thoroughly so may have issues. Update: this hook doesn't allow to add new child page if all the allowed type of templates are already added. Use only if you need to restrict child pages to the allowed templates and allow no other templates. $this->addHookAfter('ProcessPageListActions::getActions', null, function(HookEvent $event) { $p = $event->arguments[0]; $actions = $event->return; $numChildrenWithOncePerParent = count($p->children()->find('template.oncePerParent=1')->template()); if($numChildrenWithOncePerParent > 0 && (count($p->template->childTemplates) <= $numChildrenWithOncePerParent)) { unset($actions['new']); } $event->return = $actions; });
-
Hi, I remembered this module and now I needed it in a project. However, it seems that it cannot handle childrens with multiple type of templates. I would like to add 2 children pages per parent, "answer" and "review". When I add one, I cannot add the second one - so if I have added an "answer", I get "No templates allowed for adding new pages here." error when trying to add a "review". The parent template have both templates enabled as children templates. Here is a quick fix (about line 40), of course please review if needed: if($template->oncePerParent && count($parent->children("template={$template}")) > 0) { instead of if($template->oncePerParent && $parent->count("template={$template}") > 0) {
-
Linking directly between templates and field edit screens from pages
tpr replied to Vigilante's topic in Wishlist & Roadmap
If there's not much modification in the markup they should work. Of course things may break if the theme applies CSS that interferes. -
Using multiple sorts wouldn't do? Of course there can be more than one featured item but imho that's a feature, why shouldn't be more than one?