sweetalert

Is absolute positioning valuable for scroll to the element when one appears

那年仲夏 提交于 2019-12-12 04:44:41
问题 I'm using sweetalert modal dialog. It is positioned to center of screen as I understand. But when I use it inside `iframe element (by URL) it appears in the center of built-in document, and as result not seen in view area. I've tried to use position: absolute style on modal, it has not obvious influence: it is positioned as before, on the center of built-in document (why :\ ?) it is 'ensured' to seen on the view area as following: if modal rect not intersected with view area rect at all,

Change sweetalert placeholder color with css

余生长醉 提交于 2019-12-12 04:21:31
问题 I have a Sweetalert as follows: swal({ title: "my title", text: "", type: "input", imageUrl: "images/my_image.png", showCancelButton: true, closeOnConfirm: false, animation: "slide-from-top", inputPlaceholder: "username..." }, function(inputValue){ if (inputValue === false) return false; if (inputValue === "") { swal.showInputError("you didn't type anything..."); return false } }); How can I change the color of the inputPlaceholder that appears in the sweetalert. I have tried: .sweet-alert

Meteor.call don't work inside sweetalert confirmation box

。_饼干妹妹 提交于 2019-12-12 04:12:22
问题 I've got an event to delete intern messages in my app : a button in front, with a click event who call a method. Everything works fine. But before the call of the method, I'd like a confirm box "Are you sure you want to delete this message ?" With the standard confirm js function, works fine. But the standard js confirmbox... No styling allowed. So my idea was to use sweetalert : everything go well, the berts notifications as well, but no message is deleted.. Below my event, confirm box

Countdown in setInterval function with sweet Alert plugin

时光总嘲笑我的痴心妄想 提交于 2019-12-12 04:04:49
问题 I am trying to implement countdown to sweetAlert. After 20 minutes of inactivity sweet alert pops up and displays that the session is about to time out and user has two options: to log out or continue, which restarts the idle timer. The idle timer is reset also when the mouse is moved or a click is made. My problem is that I would like to display a countdown in the sweetAlert title's span ( title: "Teie sessioon on aegumas <span id='secondsLeft'></span> sekundi pärast!", )from 60-0 (seconds)

How to make Sweet alert auto close after ajax complete?

若如初见. 提交于 2019-12-11 22:03:24
问题 I'm using sweet alert, but i want make it close automatically if the request of ajax is completed swal({ title: "Are you sure?", text: "You are choosing order by custom search", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Confirm", closeOnConfirm: false, timer: **AUTO WITH AJAX??** }, I am adding a variable var dones = $(document).ajaxComplete(function(){ swal.close() }); and make swal like this swal({ title: "Are you sure?", text: "You are

SweetAlert pop-up message with JavaScript when the fields are filled

拈花ヽ惹草 提交于 2019-12-11 17:50:23
问题 I wanted to make Sweetalert to work only if all the fields are filled. I tried more versions of code, I found answers here on the forum but nothing helped. Now if I do not fill all of the fields and I click on the submit I get notification message because of HTML, but the pop-up appears too. As you can see here, altough I got the pop-up, I did not fill the last input field. function Sweetalert1(){ var name = document.getElementById("name"); var message = document.getElementById("message");

How to disable /override dependencies in Yii2

喜夏-厌秋 提交于 2019-12-11 15:30:14
问题 Problem : The 'kartik-v\yii2-dialog' which is used by 'kartik-v\tree-manager' overrides Sweetalert dialog/message box. How does one disable the treeview-manager's dependency 'kartik-v\yii2-dialog' in order to use SweetAlerts? Tried : 'assetManager' => ['bundles' => [ 'kartik\dialog\DialogAsset' => ['js' => [],], ... , Sweetalert starts working in grids and confirm events, but then treemanager no longer works (Uncaught ReferenceError: KrajeeDialog is not defined) In Pictures: Have: Want: Any

missing select options with Sweet Alert

岁酱吖の 提交于 2019-12-11 06:48:23
问题 This may be a ServiceNow issue, but I added a Sweet Alert to show a select box just so I can gather a value to pass on to the next record... but the select box is not showing, the popup is there just no box or options. What am I missing? Screenshot: Select Box Alert Thanks so much, super frustrated with something I thought would be simple to add :) swal({ title: 'Select Outage Tier', input: 'select', inputOptions: { '1': 'Tier 1', '2': 'Tier 2', '3': 'Tier 3' }, inputPlaceholder: 'required',

How to show SweetAlert in JavaScript

邮差的信 提交于 2019-12-11 04:26:01
问题 How can I show SweetAlert in this JavaScript code? function removeReg(del_reg) { if (confirm("Are you sure you want to delete? \n the reg name : " + del_reg)) { // Code goes here } } I just want to call SweetAlert in the if condition, i.e. in SweetAlert, I need to show the message "Are you sure you want to delete?" . 回答1: Call swal() with your custom options in the removeReg(del_reg) function and use the Promise returned by swal() to determine what is the user's choice: If the user clicked

How to listen for when sweet alert closes

一世执手 提交于 2019-12-10 18:40:06
问题 I am currently working with sweetalert2 and I am trying to detect when the alert closes. However the DeleteUnsavedImages function is not firing. I thought that assigning the function to the onclose key would work but no luck. swal({ html: data, showCloseButton: false, showCancelButton: false, width: 800, showConfirmButton: false, onClose: DeleteUnsavedImages() }).then(function () { }); function DeleteUnsavedImages(){ var test = "-1"; } Any help would be appreciated :-) 回答1: I tested with my