Code improving

This commit is contained in:
RainLoop Team 2016-05-22 22:16:32 +03:00
parent b7af645cbc
commit f180c2fbec
3 changed files with 18 additions and 15 deletions

View file

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2013 RainLoop Team Copyright (c) 2013 https://github.com/sharq88
Permission is hereby granted, free of charge, to any person obtaining a copy of Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in this software and associated documentation files (the "Software"), to deal in

View file

@ -9,5 +9,4 @@ class ParseExcelListPlugin extends \RainLoop\Plugins\AbstractPlugin
{ {
$this->addJs('js/parse_excel_list.js'); // add js file $this->addJs('js/parse_excel_list.js'); // add js file
} }
} }

View file

@ -1,18 +1,22 @@
$(function () { (function(window, $) {
//selectors $(function() {
var inputs = '.popups .inputosaurus-input input[type="text"]:first, \
.popups .cc-row input[type="text"]:first, \
.popups .bcc-row input[type="text"]:first';
//bind function $(window.document).on('keyup', '.b-compose .b-header .inputosaurus-input input[type="text"]:first', function() {
$(document).on( 'keyup', inputs, function(){
var t = $(this); var
var v = t.val(); $this = $(this),
if( v != "" && v.match(/@/ig).length >= 2 ){ value = $this.val()
t.val( t.val().replace(/\n| /ig,",") ) ;
if (value && value.match(/@/ig).length >= 2)
{
$this.val($this.val().replace(/\n| /ig, ','));
} }
}); });
}); });
}(window, $))