~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/javascript/client.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2012-01-05 01:16:46 UTC
  • mfrom: (14628.1.2 js-client-link)
  • Revision ID: launchpad@pqm.canonical.com-20120105011646-dlhd7oqm9pui6yk1
[r=benji][bug=911973] Set lp_original_uri properly for objects
        returned by named_get and named_post that have a self_link.

Show diffs side-by-side

added added

removed removed

Lines of Context:
343
343
            representation = Y.JSON.parse(response.responseText);
344
344
            // If the response contains a notification header, display the
345
345
            // notifications.
346
 
            notificaxns = response.getResponseHeader('X-Lazr-Notifications');
347
 
            if (notificaxns !== null) {
348
 
                module.display_notifications(notificaxns);
 
346
            var notifications = response.getResponseHeader(
 
347
                'X-Lazr-Notifications');
 
348
            if (notifications !== null) {
 
349
                module.display_notifications(notifications);
 
350
            }
 
351
            if (Y.Lang.isValue(representation) &&
 
352
                Y.Lang.isValue(representation.self_link)) {
 
353
                uri = representation.self_link;
349
354
            }
350
355
            wrapped = client.wrap_resource(uri, representation);
351
 
            result = old_on_success(wrapped);
 
356
            var result = old_on_success(wrapped);
352
357
            if (update_cache) {
353
358
              module.update_cache(wrapped);
354
359
            }
801
806
        if (representation === null || representation === undefined) {
802
807
            return representation;
803
808
        }
804
 
        if (representation.lp_redirect_location !== undefined) {
805
 
            uri = representation.lp_redirect_location;
806
 
        }
807
809
        if (representation.resource_type_link === undefined) {
808
810
            // This is a non-entry object returned by a named operation.
809
811
            // It's either a list or a random JSON object.