use simple warning

pull/1/head
yann300 8 years ago
parent f2067299ef
commit eddcee2f37
  1. 24
      src/app.js
  2. 5
      src/app/staticanalysis/staticAnalysisView.js

@ -110,27 +110,6 @@ var run = function () {
self.event.trigger('tabChanged', [cls])
}
function triggerTabWarning (target, cb) {
target = '#header #menu ' + target
$(target).css('background-color', '#d2ca24')
animateTab(target, function () {
$(target).css('opacity', '1')
animateTab(target, function () {
$(target).css('background-color', 'transparent')
$(target).css('opacity', '1')
if (cb) { cb() }
})
})
}
function animateTab (target, cb) {
$(target).animate({
'opacity': 0.3
}, 800, function () {
cb()
})
}
// ------------------ gist publish --------------
$('#gist').click(function () {
@ -470,9 +449,6 @@ var run = function () {
var staticanalysis = new StaticAnalysis(compiler.event, renderer, editor, offsetToLineColumnConverter)
$('#staticanalysisView').append(staticanalysis.render())
staticanalysis.event.register('warning', function () {
triggerTabWarning('.staticanalysisView')
})
var autoCompile = document.querySelector('#autoCompile').checked

@ -2,10 +2,8 @@
var StaticAnalysisRunner = require('./staticAnalysisRunner.js')
var yo = require('yo-yo')
var $ = require('jquery')
var EventManager = require('../../lib/eventManager')
function staticAnalysisView (compilerEvent, renderer, editor, offsetToColumnConverter) {
this.event = new EventManager()
this.view = null
this.renderer = renderer
this.editor = editor
@ -83,9 +81,10 @@ staticAnalysisView.prototype.run = function () {
})
})
if (warningContainer.html() === '') {
$('#header #menu .staticanalysisView').css('color', '')
warningContainer.html('No warning to report')
} else {
self.event.trigger('warning', [])
$('#header #menu .staticanalysisView').css('color', '#FF8B8B')
}
})
} else {

Loading…
Cancel
Save