Merge showFileHandler into the event handler

pull/1/head
Alex Beregszaszi 8 years ago
parent fc98e42bbf
commit 0c2e4753c9
  1. 13
      src/app.js

@ -138,6 +138,7 @@ var run = function () {
var $el = $(this)
selectTab($el)
})
var selectTab = function (el) {
var match = /[a-z]+View/.exec(el.get(0).className)
if (!match) return
@ -220,7 +221,11 @@ var run = function () {
})
// Switch tab
$filesEl.on('click', '.file:not(.active)', showFileHandler)
$filesEl.on('click', '.file:not(.active)', function (ev) {
ev.preventDefault()
swicthToFile($(this).find('.name').text())
return false
})
// Edit name of current tab
$filesEl.on('click', '.file.active', function (ev) {
@ -277,12 +282,6 @@ var run = function () {
updateFiles()
}
function showFileHandler (ev) {
ev.preventDefault()
swicthToFile($(this).find('.name').text())
return false
}
// Synchronise tab list with file names known to the editor
function updateFiles () {
var $filesEl = $('#files')

Loading…
Cancel
Save