~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/translations/javascript/sourcepackage_sharing_details.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-04-14 23:34:30 UTC
  • mfrom: (12813.2.1 fix-branch-precondition)
  • Revision ID: launchpad@pqm.canonical.com-20110414233430-7vsqaz4fx64uvcnu
[r=allenap][bug=758919] Fix 412 Precodition failed setting branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
542
542
    usage_overlay.set('form_submit_callback', function(form_data) {
543
543
        usage_overlay.hide();
544
544
        var product = sharing_controller.get('product');
 
545
        function reload_entry(config, entry) {
 
546
            lp_client.get(entry.get('self_link'), config);
 
547
        }
 
548
        function get_productseries(config) {
 
549
            var productseries = sharing_controller.get('productseries');
 
550
            reload_entry(config, productseries);
 
551
        }
 
552
        function replace_productseries(config, new_productseries) {
 
553
            sharing_controller.replace_productseries(new_productseries);
 
554
            config.on.success();
 
555
        }
545
556
        function get_product(config) {
546
 
            lp_client.get(product.get('self_link'), config);
 
557
            reload_entry(config, product);
547
558
        }
548
559
        function replace_product(new_product) {
549
560
            sharing_controller.replace_product(new_product);
553
564
        css_selector = sharing_controller.visible_check_selector(usage);
554
565
        var io_handler = new IOHandler(
555
566
            css_selector, new Y.lp.client.FormErrorHandler());
556
 
        var config = io_handler.chain_config(get_product, replace_product);
 
567
        var config = io_handler.chain_config(
 
568
            get_productseries, replace_productseries, get_product,
 
569
            replace_product);
557
570
        submit_form(
558
571
            config, form_data, product, '+configure-translations', 'change');
559
572
    });