Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(154)

Unified Diff: app/views/topology/importexport.js

Issue 10500044: Make charms able to be dragged to the environment.
Patch Set: Make charms able to be dragged to the environment. Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/views/charm-panel.js ('k') | app/views/topology/service.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/views/topology/importexport.js
=== modified file 'app/views/topology/importexport.js'
--- app/views/topology/importexport.js 2013-06-25 20:49:59 +0000
+++ app/views/topology/importexport.js 2013-06-26 13:58:04 +0000
@@ -98,7 +98,14 @@
reader.readAsText(file);
});
} else {
- env.importEnvironment(evt._event.dataTransfer.getData('Text'));
+ // If this is not a drop event generated by the application (all
+ // of which have a dataType), then it was caused by dropping
+ // something external to the app, in which case it might be an
+ // environment configuration, so process it as such.
+ var dataType = evt._event.dataTransfer.getData('dataType');
+ if (dataType === undefined) {
+ env.importEnvironment(evt._event.dataTransfer.getData('Text'));
+ }
}
evt.preventDefault();
evt.stopPropagation();
« no previous file with comments | « app/views/charm-panel.js ('k') | app/views/topology/service.js » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b