Clicking on cancel inside a popover doesn't reload the page

This commit is contained in:
Frederic Guillot
2015-01-30 22:06:10 -05:00
parent 5efb06f6f3
commit 746e1a4e3d
6 changed files with 19 additions and 14 deletions

View File

@@ -14,7 +14,7 @@
<div class="form-actions"> <div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?> <?= t('or') ?>
<?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $project['id'])) ?> <?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
</div> </div>
</form> </form>
</section> </section>

View File

@@ -14,7 +14,7 @@
<div class="form-actions"> <div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?> <?= t('or') ?>
<?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $project['id'])) ?> <?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
</div> </div>
</form> </form>
</section> </section>

View File

@@ -59,7 +59,7 @@
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?> <?= t('or') ?>
<?php if ($ajax): ?> <?php if ($ajax): ?>
<?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> <?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?>
<?php else: ?> <?php else: ?>
<?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?php endif ?> <?php endif ?>

View File

@@ -74,7 +74,7 @@
<div class="form-actions"> <div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?> <?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $values['project_id'])) ?> <?= t('or') ?> <?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?>
</div> </div>
</form> </form>
</section> </section>

File diff suppressed because one or more lines are too long

View File

@@ -35,6 +35,11 @@ var Kanboard = (function() {
$("#popover-content").click(function(e) { $("#popover-content").click(function(e) {
e.stopPropagation(); e.stopPropagation();
}); });
$(".close-popover").click(function(e) {
e.preventDefault();
$('#popover-container').remove();
});
if (callback) { if (callback) {
callback(); callback();