modal-dialog

rails 3, how add a simple confirmation dialog when user clicks a link

霸气de小男生 提交于 2019-12-10 03:09:24
问题 what is the easiest way in rails 3 to to ask "Are you sure you want to do that?" when the user clicks on a link? the link in this case overwrites some data with a new value. It's a simple link_to (GET) back to the same controller method, with a param[] added. 回答1: EDIT: <%= link_to "Do something", {:controller => "foo", :action => "bar"}, :confirm => "Are you sure you want to do that?" %> 回答2: For those like me that came here but are on Rails 4/5: link_to "Title", some_path, data: { confirm:

jQuery dialog always centered

▼魔方 西西 提交于 2019-12-10 02:49:52
问题 How can I implement, that a jQuery modal dialog with auto width & height is always centered in the browser. Also after resizing the window of the browser. The following code doesn't work. I think the problem is the auto width & height. jQuery - code $("<div class='popupDialog'>Loading...</div>").dialog({ autoOpen: true, closeOnEscape: true, height: 'auto', modal: true, title: 'About Ricky', width: 'auto' }).bind('dialogclose', function() { jdialog.dialog('destroy'); }).load(url, function() {

When browser back button is clicked, bootstrap modal is closed but modal-dropback stays

女生的网名这么多〃 提交于 2019-12-10 01:25:29
问题 I am using Backbone with bootstrap. Problem is when you go through application and in some point you open bootstrap modal window and press back button, modal window closes but modal background div (modal-backdrop) stays and does not disappear. It overlays whole screen and you cant click on anything. I noticed that when you close modal normally modal-backdrop div is removed from html and in this situation it stays. I was searching for this solution on web, and found similar things, but none of

Prevent JQuery Mobile from closing a popup when user taps outside of it

大城市里の小女人 提交于 2019-12-10 00:55:18
问题 I'm using JQuery Mobile 1.2.0 alpha 1. Currently, when I open a popup and tap outside of it anywhere on the screen the popup is being closed. I was wondering if there's any JQuery Mobile attribute I have missed which can be set and prevent closing the popup upon outside-tap? (modal popup) (The documentation for popups can be found here) EDIT: I had an idea of solving this but still can't implement it to work: When a JQM popup show up theres a div which covers all of the screen with class of

Help With Setting Cookie for a JQuery UI Modal Dialog

一曲冷凌霜 提交于 2019-12-10 00:20:30
问题 We host an internet banking site and upon logging in, I created a modal dialog box to display. We now want to take a cookie based approach so it's only seen once. I'm completely lost on how to do this. I have the code included and if someone could help, I'd really appreciate it. I'd need exactly how to code this. I'm not very skilled in html/javascript - I was able to implement this quite luckily honestly. But now I'm unable to get the cookie portion working! Thanks to anyone who is able to

Dialog keypress and DOM

 ̄綄美尐妖づ 提交于 2019-12-10 00:20:06
问题 I'm trying to use jQuery's keypress to trigger a button click on a modal dialog created using the jQuery dialog function. The problem is, with the following code, it works the first time around (pressing enter presses the Save button) but I get erratic behavior when I close the modal dialog and reopen it. I'm thinking some variant of $(this).("button:contains('Save')") would work, but that doesn't work. $('#dialog').keypress(function(e) { if (e.which == 13) { $("button:contains('Save')")

Rails App with Bootstrap Modal View containing form, submit and disappear modal view without reloading page

瘦欲@ 提交于 2019-12-09 23:52:23
问题 I have a rails app which presents a form for visitors in a modal view. When the submit button is clicked, I want the form to submit and the modal view to disappear without reloading the page behind it. I've tried binding the modal view's dismissal to the form's submit function in javascript, but it's not working correctly. I'm a javascript newbie, so I might not have scripted this correctly. Here's what I have: <script type="text/javascript"> $("document").on("submit", ".new_user", function()

UIModalPresentationFormSheet on iPad in landscape mode

不打扰是莪最后的温柔 提交于 2019-12-09 23:41:17
问题 I created a UIViewController view from XIB with modalPresentationStyle set to UIModalPresentationFormSheet and everything works great in portrait mode. When I switch to landscape the view gets moved upperleft (it's not centered as it should be) and most part of it is clipped. Any ideas why this is happening and how to solve it? Thanks 回答1: I had this problem as well. Turned out, I had the autorotate function set to Portrait for both the modal controller and the calling controller. 回答2: In iOS

prettyPrint() only has an effect once. (google-prettify)

≯℡__Kan透↙ 提交于 2019-12-09 23:34:00
问题 I have this JavaScript (with jQuery): var g_files_added, socket, cookie, database = null; var file_contents = []; function viewFile(key, filename) { $('#title-filename').text(filename); $('.prettyprint').text(file_contents[key]); $('#viewFileModal').modal('show'); } $(document).ready(function() { $(document).on('shown', '#viewFileModal', function(event) { prettyPrint(); }); }); // Variables have been set in code not shown, irrelevant to problem. // prettyPrint() is called everytime the

Strange mootools window dragging behaviour

走远了吗. 提交于 2019-12-09 22:32:02
问题 I have a drag-able mootools modal window. The content of the window is a iFrame. I drag the window from inside the iFrame. (it drags but shakes a lot during dragging) Live link here . Question : why this strange drag behaviour? the iFrame leaves its border, empty, on the origin place. How to avoid this? Thankfull for ideas/tips on were to search for problem. My code: window.addEvent('domready',function() { document.getElementById('iframe2_footer').addEventListener('mousedown', mouseDown,