diff options
author | Eric Guzman | 2012-07-20 11:24:19 -0700 |
---|---|---|
committer | Eric Guzman | 2012-07-20 11:24:19 -0700 |
commit | 3cc29231852440508bdeec1964e40ce59f979f99 (patch) | |
tree | 2faaf3d49337437e4a84818fe24dc64a60f8c611 /js/io/ui | |
parent | 8fdf2fc8aefee68aec4c7b5891e0375f704cbf26 (diff) | |
parent | 9053e2037821a5c8405fabb74db9635deacfe8d5 (diff) | |
download | ninja-3cc29231852440508bdeec1964e40ce59f979f99.tar.gz |
Merge branch 'refs/heads/master' into fixes_7.1
Diffstat (limited to 'js/io/ui')
-rwxr-xr-x | js/io/ui/cloudpopup.reel/cloudpopup.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/js/io/ui/cloudpopup.reel/cloudpopup.js b/js/io/ui/cloudpopup.reel/cloudpopup.js index 200eb703..914b2105 100755 --- a/js/io/ui/cloudpopup.reel/cloudpopup.js +++ b/js/io/ui/cloudpopup.reel/cloudpopup.js | |||
@@ -117,11 +117,21 @@ exports.CloudPopup = Montage.create(Component, { | |||
117 | downloadCloudApp: { | 117 | downloadCloudApp: { |
118 | enumerable: false, | 118 | enumerable: false, |
119 | value: function() { | 119 | value: function() { |
120 | //Creating an empty anchor to link to download file | ||
121 | var link = document.createElement('a'), evt = document.createEvent("MouseEvents"); | ||
122 | link.download = 'Ninja-Local-Cloud'; | ||
123 | this.element.appendChild(link); | ||
124 | //Creating a fake click event to init file download | ||
125 | evt.initMouseEvent("click", true, true, window, 1, 0, 0, 0, 0,false, false, false, false, 0, null); | ||
126 | //Setting proper download file based on OS | ||
120 | if(this._os === 'mac') { | 127 | if(this._os === 'mac') { |
121 | location.href = '/ninja_localcloud_for_mac.zip'; | 128 | link.href = '/ninja_localcloud_for_mac.zip'; |
129 | link.dispatchEvent(evt); | ||
122 | } else if (this._os === 'windows') { | 130 | } else if (this._os === 'windows') { |
123 | location.href = '/ninja_localcloud_for_windows.zip'; | 131 | link.href = '/ninja_localcloud_for_windows.zip'; |
132 | link.dispatchEvent(evt); | ||
124 | } else { | 133 | } else { |
134 | //Alerting user their OS is not supported | ||
125 | alert('Your operating system is not supported by the Ninja Local Cloud App.'); | 135 | alert('Your operating system is not supported by the Ninja Local Cloud App.'); |
126 | } | 136 | } |
127 | } | 137 | } |