Double data-confirm prompt observed on rails with framework7

强颜欢笑 提交于 2019-12-08 11:37:50

问题


When you use data-confirm on framework7 embedded in rails, a double prompt is observed. The first prompt is coming from Rails. The other is coming from framework7.

<div class="swipeout-actions-right">
  <a id="more_button" href="#" data-task-id={{id}} class="demo-actions">
      <span class="small">More</span>
    </a>
  <a id="archive_button" href="#" data-task-id={{id}} class="bg-blue demo-actions">
      <span class="small">Archive</span></a>
  <a href="#" class="bg-green swipeout-delete swipeout-overswipe" data-confirm="Are you sure want to delete this item?">
    <span class="small">Complete</span>
  </a></div>

Does anyone has a recommended solution to the double prompt of data-confirm this?


回答1:


Update: I fix it by disabling rails.confirm

$.rails.confirm = function(){return true} 

You can also fix the issue by removing //= require jquery_ujs.



来源:https://stackoverflow.com/questions/45433422/double-data-confirm-prompt-observed-on-rails-with-framework7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!