Subversion Repositories SmartDukaan

Rev

Rev 37508 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37508 Rev 37559
Line 797... Line 797...
797
    $(document).on('input', '#url', function () {
797
    $(document).on('input', '#url', function () {
798
        if ($('#selectedUrl').val() === 'other') {
798
        if ($('#selectedUrl').val() === 'other') {
799
            $('#nmSummaryTap').text($(this).val() || '—');
799
            $('#nmSummaryTap').text($(this).val() || '—');
800
        }
800
        }
801
    });
801
    });
-
 
802
    // "None" tap behaviour hides the Link picker entirely so the admin can ship
-
 
803
    // an info-only notification (no navigation, no CTA).
-
 
804
    $(document).on('change', '#type', function () {
-
 
805
        if ($(this).val() === 'none') {
-
 
806
            $('#nmLinkField').hide();
-
 
807
            $('#selectedUrl').val('');
-
 
808
            $('#url').val('').hide();
-
 
809
            $('#nmSummaryTap').text('None');
-
 
810
        } else {
-
 
811
            $('#nmLinkField').show();
-
 
812
        }
-
 
813
    });
802
    $(document).on('change', '#fofo-users, #state-users, #internal-users', updateRecipientSummary);
814
    $(document).on('change', '#fofo-users, #state-users, #internal-users', updateRecipientSummary);
803
 
815
 
804
    function refreshCategorySummary() {
816
    function refreshCategorySummary() {
805
        $('#nmSummaryCategory').text(getActiveCategorySelect().find('option:selected').text() || 'Not set');
817
        $('#nmSummaryCategory').text(getActiveCategorySelect().find('option:selected').text() || 'Not set');
806
    }
818
    }
Line 1263... Line 1275...
1263
        return confirm(confirmText);
1275
        return confirm(confirmText);
1264
    }
1276
    }
1265
 
1277
 
1266
    function submitNotification(scheduledTimestamps, onSuccess) {
1278
    function submitNotification(scheduledTimestamps, onSuccess) {
1267
        var fmt = activeFormat();
1279
        var fmt = activeFormat();
-
 
1280
        var typeVal = $('#type').val();
1268
        var linkVal = $('#selectedUrl').val();
1281
        var linkVal = $('#selectedUrl').val();
-
 
1282
        var effectiveUrl = (typeVal === 'none')
-
 
1283
            ? ''
1269
        var effectiveUrl = (linkVal === 'other') ? $('#url').val() : linkVal;
1284
            : (linkVal === 'other' ? $('#url').val() : linkVal);
1270
        var category = getActiveCategorySelect().val();
1285
        var category = getActiveCategorySelect().val();
1271
 
1286
 
1272
        var selectedGroup = $('#nmCampaignGroup').val();
1287
        var selectedGroup = $('#nmCampaignGroup').val();
1273
        var campaignGroupId = (selectedGroup && selectedGroup !== '__new__') ? parseInt(selectedGroup, 10) : null;
1288
        var campaignGroupId = (selectedGroup && selectedGroup !== '__new__') ? parseInt(selectedGroup, 10) : null;
1274
 
1289