turbolinks

How to update vuejs component data after jquery calls when use turbolinks

断了今生、忘了曾经 提交于 2019-12-11 07:34:57
问题 I have a vuejs's component that after mounted should show data fetched from server and use response to update data. When I use turbolinks the vue js don't update the dom. I tried many different ways to do that, but none worked =(, my last tried was this one: Vue.component('pf-main-menu', { props: [''], template: '<pf-menu v-bind:links="links"></pf-menu>', data: function () { return { links: [{text: 'teste'}] } }, mounted: function() { this.links = [{text: 'teste 2'}]; <-- This change works $

How do I make this snippet of CoffeeScript TurboLinks 5 friendly?

流过昼夜 提交于 2019-12-11 05:48:32
问题 I have the following: $ -> $('[data-provider="summernote"]').each -> $(this).summernote height: 300 And this works, however, I would like to make it TurboLinks 5 friendly. So I tried the following: $ -> ready = -> $('data-provider="summernote"]').each -> $(this).summernote height: 300 $(document).ready(ready) $(document).on('page:load', ready) But I keep getting this error: Uncaught ReferenceError: ready is not defined How do I fix this so that I make the original snippet TL-5 friendly? Edit

Bootstrap navbar collapse menu not working with Turbolinks

元气小坏坏 提交于 2019-12-10 12:54:31
问题 Bootstrap navbar collapse menu not working with Turbolinks. Working scenario On page load <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> </button> <div class="navbar-collapse collapse" id="menu"> </div> Click menu and dropdown <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> </button> <div class="navbar-collapse in" id="menu" style="height: auto;"> </div> Click menu again and collapse <button

Turbolinks not working - instead loads page twice

一世执手 提交于 2019-12-10 11:30:07
问题 So, in my Rails 4 app I have Turbolinks gem. //= require jquery.js //= require jquery.turbolinks //= require turbolinks However, something seems to be wrong. Isn't the point of Turbolinks that you don't have to load all the jquery/css/asset pipeline other than once at start? Well, that doesn't seem to happen, and it proceeds to load all jquery each time new page is requested, and what's more, it even makes each page load twice . Such as: Started GET "/" for ip at 2014-01-21 18:55:35 +0200

Rails turbolinks breaking pnotify

坚强是说给别人听的谎言 提交于 2019-12-10 11:24:53
问题 In my rails application, I have it so that when you vote, subscribe or unsubscribe from a list, it will show a popup using pnotify. This works fine until the user navigates to a different page, and now it is no longer working. This only works when page is loaded or reloaded. I know this is because turbolinks in a rails 4 application but it seems to execute all my other javascript code apart from the pnotify. Additional info.. The subscribe/unsubscribe and vote buttons have the method post and

Rails turbolinks long request doesn't show page load

為{幸葍}努か 提交于 2019-12-09 09:44:50
问题 Using turbolinks in Rails, if a request is taking a long time, either expectedly or not, the browser does not have the usual cues to show that anything is happening at all. 回答1: I have created a gist which works around this issue using a loading dialog which automatically pops up if the request is taking more than 500ms, which is configurable. https://gist.github.com/cpuguy83/5016442 @PageSpinner = spin: (ms=500)-> @spinner = setTimeout( (=> @add_spinner()), ms) $(document).on 'page:change',

How to refresh a page with Turbolinks

淺唱寂寞╮ 提交于 2019-12-09 08:28:44
问题 I understand that I can call the following code on Turbolinks 5 but it changes the scroll position. Is there a way to call Turbolinks to refresh the page and not change the scroll position? Turbolinks.visit(location.toString()); This will do what I want, but was hoping to use Turbolinks window.location.reload() 回答1: Store the current scroll position before calling visit , then when the page loads, scroll to that stored position. Resetting the stored scroll position to null ensures that

How to get filepicker and turbolinks to play well together?

六眼飞鱼酱① 提交于 2019-12-09 07:33:31
问题 I develop a web app with rails 3.2, turbolinks and Filepicker.io I loade the API key like this (coffeescript). I think $(document).ready is enough, as the filepicker script get loaded once on the first request. $(document).ready -> filepicker.setKey "MY_KEY" I load Filepicker with the following (coffeescript). I should note that I use the jquery-turbolinks gem, which builds the support for turbolinks right into jquery. jQuery -> $("#publications_bulk-new #upload-button").on "click", -> form =

TurboLinks with Angular

不问归期 提交于 2019-12-08 18:34:30
I'm running Angular 1.6 along with TurboLinks 5. For the most part, things are working well. I disabled TurboLinks cache and am manually bootstrapping Angular per some of the suggestions on this post: Using angularjs with turbolinks I have run into one issue though where I have an $interval running within a service. When changing pages via TurboLinks, Angular bootstraps again and the service creates a new interval, but the old one continues to run! Every time a page change event occurs, a new interval is created and they keep piling on top of each other. I tried destroying the angular app when

Form with remote: true not working with turbolinks

不羁的心 提交于 2019-12-08 15:18:31
I have setup a form and set remote: true on it. While it works if i directly refresh the page. IF i navigate from menu to the desired form the button just does nothing. I tried adding "data-no-turbolink="true" to the link of menu but still it doesn't work maybe because of turbolinks 5 not sure? <%= form_for :location, url: get_inventory_path, remote: true do |f| %> <div class="input-field col s12"> <%= f.select :location_id, options_for_select(@locations.collect { |l| [l.station + ', ' + l.venue + ', ' + l.area + ', ' + l.city + ', ' + l.country, l.id] }, 1), {}, { id: 'location_select', class