bootbox

ScrollTop bootbox modal on fadeIn

自作多情 提交于 2019-12-21 14:07:11
问题 I use bootbox.js to make modal but when the modal fadeIn and the content is too long, the scrollbar goes at the level of the bottom button. I need the scrollbar stay on top when modal appear 回答1: I've solved adding .off("shown.bs.modal"); after the bootbox.dialog. bootbox.dialog({ ... }).off("shown.bs.modal"); 回答2: You can set the scrollTop with jQuery in you callback. bootbox.alert("Hello world!", function() { $('body').scrollTop(0); }); 来源: https://stackoverflow.com/questions/27636095

ScrollTop bootbox modal on fadeIn

最后都变了- 提交于 2019-12-21 14:06:16
问题 I use bootbox.js to make modal but when the modal fadeIn and the content is too long, the scrollbar goes at the level of the bottom button. I need the scrollbar stay on top when modal appear 回答1: I've solved adding .off("shown.bs.modal"); after the bootbox.dialog. bootbox.dialog({ ... }).off("shown.bs.modal"); 回答2: You can set the scrollTop with jQuery in you callback. bootbox.alert("Hello world!", function() { $('body').scrollTop(0); }); 来源: https://stackoverflow.com/questions/27636095

Bootbox confirm: return client result in order to do postback to rowCommand

社会主义新天地 提交于 2019-12-21 02:50:09
问题 Before bootbox, I did this on aspx file in gridview; <asp:Button ID="btnDelete" CssClass="btn btn-danger" OnClientClick="if(!confirmDelete()) return false;" runat="server" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" CausesValidation="false" CommandName="DeleteRow" Text="Delete"/> and on js file; function confirmDelete() { return confirm("Are you sure you want to delete the record?"); } And with confirmation, the gridview's RowCommand is triggered and the deletion is done. With

Bootboxjs: how to render a Meteor template as dialog body

淺唱寂寞╮ 提交于 2019-12-17 19:52:30
问题 I have the following template: <template name="modalTest"> {{session "modalTestNumber"}} <button id="modalTestIncrement">Increment</button> </template> That session helper simply is a go-between with the Session object. I have that modalTestNumber initialized to 0 . I want this template to be rendered, with all of it's reactivity, into a bootbox modal dialog. I have the following event handler declared for this template: Template.modalTest.events({ 'click #modalTestIncrement': function(e, t)

How can I pass a file list to a bootbox callback?

痞子三分冷 提交于 2019-12-13 07:38:01
问题 When my user try to upload several files, I trigger a bootbox modal to make him decide on 2 possible options. On the bootbox callback, I want to iterate over a list of file that I get from my file input. The problem is that my file list variable is empty in the callback. Have a look at the code: this.loadFiles = function(files){ if (files.length>1){ //here, 'files' is populated bootbox.dialog({ message: APi18n.__("media_warning_multiple_file_input_modal_message"), title: TAPi18n.__("media

Bootstrap modal stops working after I sort portfolio

廉价感情. 提交于 2019-12-11 18:55:22
问题 I am building a sortable portfolio using quicksand.js, to display more information on click I am using bootbox.js, now this is working pretty well but I recently ran into an issue. When you sort the portfolio bootbox not longer works! You can see this in action here, scroll to the portfolio section and click one of the images to see it function correctly. Then sort it and try again and you will see my issue. Update: Using console I found what is causing the issue but I cant fully understand

How can I load in a bootbox a custom element with javascript methods attached?

China☆狼群 提交于 2019-12-11 06:59:05
问题 I want to use crop and resize images inside a bootbox. To achieve this, I use Cropper. Based on the examples of Cropper, I should instantiate the cropper object in my bootbox when it is displayed and get rid of it when it is closed. Is it possible or should I use a regular bootstrap modal? Could I, for instance, add a script tag in the bootbox message in order to do the job there? That would be dirty, and before I commit into this, I wanted to check for more clean/elegant approaches. 回答1: My

Bootbox callback form submit not working properly

醉酒当歌 提交于 2019-12-10 17:43:21
问题 I'm dynamically creating some forms and I'm using bootbox 4 alongside bootstrap 3 and jquery 3.1.0 in an MVC5 application. Edit: I updated my project's jquery from 1.10.2 to 3.1.0, still have the same issue below. Usage: click remove, bootbox confirm removal via modal, and if confirmed, call the .submit() action on the form. Application Screenshot The issue: I click on the delete button and it pops up a modal to confirm the action, and i click "continue" but it does nothing. There seems to be

Bootbox: Make the default button work with the ENTER key?

荒凉一梦 提交于 2019-12-10 17:04:59
问题 As the title suggests, I want to add the Enter key as an event handler for Bootbox.js. When you an alert() popup is called, you can press enter to dismiss it, but that is not the case with Bootbox.js. I do not know how to get access to the button inside Bootbox.js to add an event handler. Any suggestions? 回答1: In order for the button to take focus, it should be defined with the "btn-primary" class name: className: main: { className: "btn-primary", ... } 回答2: I see this post has no answer yet

Bootbox callback not working properly

给你一囗甜甜゛ 提交于 2019-12-10 03:54:19
问题 I'm trying to use this: $('#delete').live('click',function(){ var result; bootbox.confirm("Are you sure?", function(response){ result=response; }); alert(result); return result; }); But when the button is clicked: Alert is shown first and only after that bootbox shows confirm dialog. I want to return the response , but if i do it from within call back it doesn't work because it returns response from callback but not $('#devicedelete').live('click',function(){}); Btw i'm trying to submit a