~abreu-alexandre/unity-webapps-qml/content-hub-getpeers-failure-14-10

« back to all changes in this revision

Viewing changes to examples/api-bindings/content-peer-picker/www/js/app.js

  • Committer: CI bot
  • Author(s): Alexandre Abreu
  • Date: 2014-05-14 22:30:57 UTC
  • mfrom: (97.1.6 fix-1288801)
  • Revision ID: ps-jenkins@lists.canonical.com-20140514223057-ad1fglb4sv7emaqv
Cleanup the structure of the QML bindings to make it clearer. No Changes in functionality all features are still working & same,

This is an updated version of: https://code.launchpad.net/~abreu-alexandre/unity-webapps-qml/restructure-cleanup-bindings-qml-structure/+merge/208148 with the latest changes that got in in between Fixes: 1288801

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
    document.getElementById('pick').addEventListener('click', doContentPeerPicking);
9
9
    function doContentPeerPicking() {
10
 
        hub.launchContentPeerPicker(
11
 
            {
12
 
                contentType: hub.ContentType.Pictures,
13
 
                handler: hub.ContentHandler.Source,
14
 
            },
15
 
            function(peer) {
16
 
                if ( ! peer) {
17
 
                    nopeers();
18
 
                    return;
19
 
                }
20
 
                addPeerElement(peer.appId(), peer.name());
21
 
                doSimpleApiImport(peer);
22
 
            },
23
 
            function() {
24
 
                aborted();
25
 
            });
 
10
        hub.launchContentPeerPicker(
 
11
            {
 
12
                contentType: hub.ContentType.Pictures,
 
13
                handler: hub.ContentHandler.Source,
 
14
            },
 
15
            function(peer) {
 
16
                if ( ! peer) {
 
17
                    nopeers();
 
18
                    return;
 
19
                }
 
20
                addPeerElement(peer.appId(), peer.name());
 
21
                doSimpleApiImport(peer);
 
22
            },
 
23
            function() {
 
24
                aborted();
 
25
            }
 
26
        );
26
27
    };
27
28
 
28
29
    function addPeerElement(appId, name) {