From 52e8cb847b6694fce32def404b5a6bf7a1ac3124 Mon Sep 17 00:00:00 2001 From: Landon Abney Date: Thu, 5 Feb 2015 11:10:47 -0800 Subject: [PATCH] Set the default Pushbullet target to all devices Sets the default device to "All devices" (string choice may need changing). A user may still select a specific device if desired. Fixes SiCKRAGETV/sickrage-issues#511. Also corrects the handling of current_pushbullet_device, the variable was not defined in the inner function before. --- gui/slick/js/configNotifications.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gui/slick/js/configNotifications.js b/gui/slick/js/configNotifications.js index 2851bc53..76694278 100644 --- a/gui/slick/js/configNotifications.js +++ b/gui/slick/js/configNotifications.js @@ -426,20 +426,25 @@ $(document).ready(function(){ return false; } - var current_pushbullet_device = $("#pushbullet_device").val(); $.get(sbRoot + "/home/getPushbulletDevices", {'api': pushbullet_api}, function (data) { var devices = jQuery.parseJSON(data).devices; + var current_pushbullet_device = $("#pushbullet_device").val(); $("#pushbullet_device_list").html(''); for (var i = 0; i < devices.length; i++) { if(devices[i].active == true) { if(current_pushbullet_device == devices[i].iden) { - $("#pushbullet_device_list").append('') + $("#pushbullet_device_list").append(''); } else { - $("#pushbullet_device_list").append('') + $("#pushbullet_device_list").append(''); } } } + if (current_pushbullet_device == "") { + $("#pushbullet_device_list").prepend(''); + } else { + $("#pushbullet_device_list").prepend(''); + } if(msg) { $('#testPushbullet-result').html(msg); }