Commit 0c2e4753 authored by Alex Beregszaszi's avatar Alex Beregszaszi

Merge showFileHandler into the event handler

parent fc98e42b
...@@ -138,6 +138,7 @@ var run = function () { ...@@ -138,6 +138,7 @@ var run = function () {
var $el = $(this) var $el = $(this)
selectTab($el) selectTab($el)
}) })
var selectTab = function (el) { var selectTab = function (el) {
var match = /[a-z]+View/.exec(el.get(0).className) var match = /[a-z]+View/.exec(el.get(0).className)
if (!match) return if (!match) return
...@@ -220,7 +221,11 @@ var run = function () { ...@@ -220,7 +221,11 @@ var run = function () {
}) })
// Switch tab // 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 // Edit name of current tab
$filesEl.on('click', '.file.active', function (ev) { $filesEl.on('click', '.file.active', function (ev) {
...@@ -277,12 +282,6 @@ var run = function () { ...@@ -277,12 +282,6 @@ var run = function () {
updateFiles() updateFiles()
} }
function showFileHandler (ev) {
ev.preventDefault()
swicthToFile($(this).find('.name').text())
return false
}
// Synchronise tab list with file names known to the editor // Synchronise tab list with file names known to the editor
function updateFiles () { function updateFiles () {
var $filesEl = $('#files') var $filesEl = $('#files')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment