Subversion Repositories SmartDukaan

Rev

Rev 36726 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36726 Rev 36751
Line 1... Line 1...
1
$(function() {
1
$(function() {
2
    var selectedCatalogId = null;
-
 
3
 
2
 
4
    $(document).on('click', ".manage-flagship", function() {
3
    $(document).on('click', ".manage-flagship", function() {
5
        loadFlagship("main-content");
4
        loadFlagship("main-content");
6
    });
5
    });
7
 
6
 
8
    $(document).on('click', ".add-flagship-model", function() {
7
    $(document).on('click', ".add-flagship-model", function() {
-
 
8
        var selectedCatalogId = $('.flagship-item-search').data('catalogId');
9
        var startDate = $('#flagship-start-date').val();
9
        var startDate = $('#flagship-start-date').val();
10
        var endDate = $('#flagship-end-date').val();
10
        var endDate = $('#flagship-end-date').val();
11
 
11
 
12
        if (!selectedCatalogId) {
12
        if (!selectedCatalogId) {
13
            alert("Please select a catalog item");
13
            alert("Please select a catalog item");
Line 48... Line 48...
48
 
48
 
49
function loadFlagship(domId) {
49
function loadFlagship(domId) {
50
    doGetAjaxRequestHandler(context + "/manageFlagship", function(response) {
50
    doGetAjaxRequestHandler(context + "/manageFlagship", function(response) {
51
        $('#' + domId).html(response);
51
        $('#' + domId).html(response);
52
        getCatalogAheadOptions($('#' + domId).find('.flagship-item-search'), 70000, function(selectedItem) {
52
        getCatalogAheadOptions($('#' + domId).find('.flagship-item-search'), 70000, function(selectedItem) {
53
            selectedCatalogId = selectedItem.catalogId;
53
            $('#' + domId).find('.flagship-item-search').data('catalogId', selectedItem.catalogId);
54
        });
54
        });
55
    });
55
    });
56
}
56
}