Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed image edit

  • Loading branch information...
commit c70c6710b41f90e18d5dede03573c740ec26f91f 1 parent 6fb6c51
@pizzapanther authored
View
2  neutron/ide/static/ide/js/default.js
@@ -223,7 +223,7 @@ window.onbeforeunload = function() {
return 'Are you sure you wish to leave this page?';
}
-var canon = require('pilot/canon')
+var canon = require('pilot/canon');
canon.addCommand({
name: 'SaveFile',
View
18 neutron/static/ide/js/default.js
@@ -178,10 +178,20 @@ function uploadFile(id, onComplete) {
xhr.send(fd);
}
-function file_browser () {
- $('#file_browser > div.inner').fileTree({ root: '', script: '/filetree/', expandSpeed: 200, collapseSpeed: 200 }, function(file) {
+function get_file (file) {
+ var img_patt = /\.(jpg|jpeg|png|bmp|pxd)$/i;
+
+ if (img_patt.test(file)) {
+ window.open('/external_open' + encodeURI(file), '_blank');
+ }
+
+ else {
$.post('/fileget/', {f: file}, create_tab);
- });
+ }
+}
+
+function file_browser () {
+ $('#file_browser > div.inner').fileTree({ root: '', script: '/filetree/', expandSpeed: 200, collapseSpeed: 200 }, get_file);
}
$(document).ready( function() {
@@ -213,7 +223,7 @@ window.onbeforeunload = function() {
return 'Are you sure you wish to leave this page?';
}
-var canon = require('pilot/canon')
+var canon = require('pilot/canon');
canon.addCommand({
name: 'SaveFile',
Please sign in to comment.
Something went wrong with that request. Please try again.